03-08-2006 09:20 AM
03-08-2006 09:26 AM
Just to add a note on the security setting for Macros... I have tried Low and Medium level setting for security but Word Import Module.vi still fails.
Looking forward to your feedback.
Thanks,
Mim
03-08-2006 09:44 AM
Here's the text from the -41113 error:
"Report Generation Toolkit: You have not selected Visual Basic Project as a Trusted Source in Microsoft Word or Excel. Check the Macro Security settings in Word or Excel."
In addition to setting the macro security level to "Low", you must also follow the advice from the error message and make VB a trusted macro source. To do this in Word 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". If you do this, you should be good...I've used the Word Import Module.vi several times without difficulty as long as I had these settings correct. To double-check that it works right, you can also run the Word Macro example at examples\office\Word Examples.llb\Run Macro on Word Table.vi.
If you're still having trouble even after making this change, you may want to check with your IT department to make sure they don't have any software installed on your machine that blocks macros from running.
Good luck,
-D
03-08-2006 10:03 AM
darren,
thanks for your reply.
After checking the the property "Trust access to Visual Basic Project" , I get the following error message:
Exception occured in Microsoft Word, Unable to run the specified macro. Help Path is C:\Program Files\Microsoft Office\OFFICE11\1033\wdmain11.chm and context 37401 in Word Run Macro.vi->SetFirstRowAsTableHeaderforWord(Macro).vi->Generate Report.vi
I can run the macro directly from Word.. no problem running macros in Excel dirently either. I get error message only when running macro from LabView. So, I doubt if it is an IT issue.
You don't have a problem with Word 2003 and Word Import Module.vi???
I am attaching my Vi-Report Generation.vi and the subvi. I would so much appreciate if you run ReportGenerate.vi on your PC and let me know if there is a problem.
Many Thanks for your help.
Mim
03-08-2006 10:08 AM