简体   繁体   English

Excel Services Sharepoint 2010从xlsm文件中删除宏

[英]Excel Services Sharepoint 2010 removes macros from xlsm file

I am using Excel Services in Sharepoint 2010 to inject some data into an Excel xlsm file. 我在Sharepoint 2010中使用Excel Services将一些数据注入到Excel xlsm文件中。 This is working fine. 一切正常。

I know that macros will not run on the Sharepoint server, but I want users to be able to download the full workbook after the data injection and have the macros enabled in the full workbook. 我知道宏将不会在Sharepoint服务器上运行,但是我希望用户能够在数据注入后下载完整的工作簿,并在完整的工作簿中启用宏。 But, it seems that when Excel Services injects the data, the workbook is always saved with the macros stripped out of the file. 但是,似乎当Excel Services注入数据时,工作簿总是与删除文件中的宏一起保存。 Is there any way around this? 有没有办法解决?

How does Excel Services "inject" data? Excel Services如何“注入”数据? Consider using a data connection in the Excel file instead. 考虑在Excel文件中使用数据连接。

To do that, create a view that shows the data you want and export to Excel. 为此,创建一个显示所需数据并导出到Excel的视图。 The file now has a data connection to the SharePoint list. 该文件现在具有到SharePoint列表的数据连接。 You can configure the connection settings and use the data in the spreadsheet. 您可以配置连接设置并使用电子表格中的数据。 You can hide the sheet with the SharePoint data if it messes up the workbook look. 如果工作表外观混乱,则可以使用SharePoint数据隐藏工作表。

Or, use the file "injected" with Excel Services as a source file and create a separate file that runs the VBA. 或者,将Excel Services的“注入”文件用作源文件,并创建一个运行VBA的单独文件。 Open the injected file and read its data with VBA. 打开注入的文件,并使用VBA读取其数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM