Spread Windows Forms Support- .xlsm(Macro Enabled)

Posted by: srikanthc2010 on 8 September 2017, 3:23 pm EST

    • Post Options:
    • Link

    Posted 8 September 2017, 3:23 pm EST

    Hi,

    We are using Spread Window Forms for Excel support.

    We have to design application to support for .xlsx and .xlsm(Macro Enabled).

    Does this Spread supports for .xlsm support or not?

    If supports .xlsm could you tell me how to get List of macros from Excel workbook using spread?

    Thanks,

    Srikanth

  • Posted 8 September 2017, 3:23 pm EST

    Hi,

    Spread Windows Forms has very limited support for XLSM. The XLSM support is limited to importing the macro content (including all unsupported content in the workbook like pivot tables, VBA content, macros, etc.) and caching it in memory for later exporting to XLSM (possibly with some changes that you have made using the Spread API). Spread cannot return any of the macro content from the API.

    For more information about the document caching feature, please see the help topics about ExcelOpenFlags.DocumentCaching and ExcelSaveFlags.DocumentCaching:

    http://sphelp.grapecity.com/WebHelp/SpreadNet9/WF/webframe.html#FarPoint.Excel~FarPoint.Excel.ExcelOpenFlags.html

    http://sphelp.grapecity.com/WebHelp/SpreadNet9/WF/webframe.html#FarPoint.Excel~FarPoint.Excel.ExcelSaveFlags.html

    Regards,

    -Sean

  • Posted 8 September 2017, 3:23 pm EST

    Hello,

    We can open .xlsm i.e. macro enabled file in Spread using OpenExcel() method along with ExcelOpenFlags set to DocumentCaching/ DocumentCaching only.

    http://sphelp.grapecity.com/WebHelp/SpreadNet9/WF/webframe.html#FarPoint.Excel~FarPoint.Excel.ExcelOpenFlags.html

    http://sphelp.grapecity.com/WebHelp/SpreadNet9/WF/webframe.html#FarPoint.Excel~FarPoint.Excel.ExcelSaveFlags.html

    However, we cannot fetcg macros at Spread level i.e. it’s just that Excel macros are intact while importing and Exporting Excel containing macros but we cannot play around with macros at Spread level.

    Hope it clarifies.

    Thanks,

    Reeva

  • Posted 25 May 2018, 5:31 am EST - Updated 30 September 2022, 2:17 pm EST

    Hi

    We are saving file by using below code,

    	if (Path.GetExtension(fileName) == ".xlsm")
               {
                    pResult = SaveExcel(fileName, FarPoint.Excel.ExcelSaveFlags.DocumentCaching | FarPoint.Excel.ExcelSaveFlags.UseOOXMLFormat);
                }
                else
                {
                    SaveExcel(fileName, FarPoint.Excel.ExcelSaveFlags.UseOOXMLFormat);
                }
    

    With this code for “.xlsx” files we did not find any issues, but for “.xlsm” we are having problem like if we try to open saved file it is throwing below message. Could you please tell me how can i fix this issue.

    Thanks

    Siva

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels