To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This simple example shows how to use Report Generation Toolkit to process Excel document.
Description
This code open an Excel document Book1 and use the Excel Import Module VI with the Excel Run Macro VI to run macros defined in external modules to process the Excel document. After the macro runs, use the Excel Remove Module VI to remove the external module from the Visual Basic project. Finally, save the results as a new Excel document named Book2.
Requirements
Steps to Implement or Execute Code
Additional Information or References
Why do I get error -41113 at Excel Import Module VI when using the Report Generation Toolkit?
Solution:
To get rid of this error you must follow the advice from the error message and make Visual Basic a trusted macro source.
In Microsoft Excel 2003 go to Tools»Options»Security»Macro Security»Trusted Publishers and click the checkbox next to both Trust all installed add-ins and templates and Trust access to Visual Basic Project.
In Microsoft Excel 2007, click the Office Button in the top left then click Excel Options. Click on Trust Center from the list on the left, and then click Trust Center Settings... Click on Macro Settings and check the box for Trust access to the VBA project object model.
In Microsoft Excel 2010 and later, click the File Tab in the top left then click Options. Click on Trust Center from the list on the left, and then click Trust Center Settings... Click on Macro Settings and check the box for Trust access to the VBA project object model.
It may be necessary to restart the computer after making this change for it to take effect in LabVIEW.
Related Links:
Report Generation Toolkit Compatibility with Microsoft Office and LabVIEW
VI Block Diagram
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
缺一大堆子Vi,拜托将整个项目上传可以吗?