mercredi 6 mai 2015

Fill SERFF template XLSM File using C# EPPLUS library?

How to fill the SERFF template containing MACROS using EPPLUS Library. When i tried to edit template using this code the SERFF template crashes here is code i am using for editing and exporting template we can get SERFF template from here http://ift.tt/1ADYeVq

FileInfo newFile = new FileInfo(@"D:\FFM Sharred\SERFF-PlansBenefits.xlsm");

ExcelPackage pck = new ExcelPackage(newFile);

var ws = pck.Workbook.Worksheets.First();

ws.SetValue("B2", "33333");

Response.BinaryWrite(pck.GetAsByteArray());
Response.ContentType = "application/vnd.ms-excel.sheet.macroEnabled.12";           
Response.AddHeader("content-disposition", "attachment;  filename=Sample4.xlsm"); 

Aucun commentaire:

Enregistrer un commentaire