电子表格在尝试导出.xlsm文件时显示警告消息。
导出按钮代码:
var binData = new byte[filename.PostedFile.ContentLength];
filename.PostedFile.InputStream.Read(binData, 0, filename.PostedFile.ContentLength);
filename.PostedFile.InputStream.Close();
Stream st = new MemoryStream(binData);
Download excel = new Download();
byte[] result = excel.Generate(list, st, code);
Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", filename.FileName));
Response.ContentType = "application/vnd.ms-excel.sheet.macroEnabled.12";
Response.BinaryWrite(result);