The answer is "no", but this issue relates to Excel and Internet Explorer, not ExcelWriter. ExcelWriter preserves all VBA macros when processing a spreadsheet. However, not all VBA will execute in the Excel browser plug-in. In order to guarantee that all your macros will run in your ExcelWriter-generated files, it is recommended to use the Save option that will open the spreadsheet in a separate Excel window rather than in the browser.
See this Microsoft Article: Some Macro Commands Are Not Run in MS Internet Explorer
Examples:
ExcelTemplate .NET
C#:
ExcelTemplate xlt = new ExcelTemplate();
xlt.Open("C:\\mytemplates\\WorkbookWithMacros.xls")
xlt.SetDataSource("DataSourceName",myDataSet);
xlt.Process();
//Save with the openInBrowser parameter to false
xlt.Save(Page.Response,"WorkbookWithMacros_out.xls",false)
ExcelApplication .NET
C#:
ExcelApplication xla = new ExcelApplication();
Workbook wb = xla.Open("C:\\myspreadsheets\\WorkbookWithMacros.xls")
//Rest of your code here...
//Save with the openInBrowser parameter to false
xla.Save(wb,Page.Response,"WorkbookWithMacros_out.xls",false)
ExcelTemplate COM
VBScript:
Set xlt = Server.CreateObject("SoftArtisans.ExcelTemplate")
xlt.Open "C:\myspreadsheets\WorkbookWithMacros.xls"
xlt.DataSource("DataSourceName") = myRecordset
' ExcelTemplate COM has no Save method, it does everything in .Process
' Set the ProcessMethod parameter to saProcessOpenInExcel
xlt.Process "WorkbookWithMacros_out.xls", saProcessOpenInExcel
ExcelApplication COM
VBScript:
Set xla = Server.CreateObject("SoftArtisans.ExcelApplication")
xla.Open "C:\myspreadsheets\WorkbookWithMacros.xls"
' Rest of your code here ...
' Save with ProcessMethod parameter set to saProcessOpenInExcel
xlt.Save "WorkbookWithMacros_out.xls", saProcessOpenInExcel, saFileFormatDefault
Related Articles:
This MS article discusses several other Excel features which do not work by default when a spreadsheet is opened in the browser. Workbook Settings Ignored or Disabled in MS Internet Explorer |