使用报表生成工具包生成EXE后无法启动Word or Excel报表



主要软件:
主要软件版本: 1.0
主要软件修正版本: N/A
次要软件: N/A

问题: 我正在使用使用Report.vi来创建一个Microsoft Office报表。当我在开发环境时可以打开Word或Excel报表,但是生成可执行文件后却无法打开了

解答:

这个报表生成工具包中的Report.vi动态地调用了一些vi来打开Excel和Word,因此,如果要在可执行程序中实现打开,两个支持文件必须作为动态调用的vi被包含入生成的可执行文件中:

这个具体的实现过程依赖于您正使用的

LabVIEW 7.1 and 8.0

  1. 打开您想生成EXE的vi
  2. 点击 Tools»Build Executable ( version 8.0) 或者 Build Application ( version 7.1)
  3. 点击 Source Files 选项卡
  4. 点击 Add Dynamic VI
  5. 浏览文件,您可以在以下路径找到您需要的文件: labview\vi.lib\addons\_office
  6. 点击对应的llb并应用到您的viI: exclsub.llb ( Microsoft Excel) 或者 wordsub.llb (Microsoft Word)
  7. 选择对应的 Excel Dynamic VIs 或者 Word Dynamic VIs

LabVIEW 8.2 and 8.5

  1. 添加您希望生成可执行程序的vi到项目中. 
  2. 在项目树页面,右击 My Computer»Add»File
  3. 浏览文件,您可以在以下路径找到您需要的文件: labview\vi.lib\addons\_office
  4. 点击对应的llb并应用到您的vi中: exclsub.llb (Microsoft Excel) or wordsub.llb (Microsoft Word)
  5. 选择  _Word Dynamic VIs.vi 或者 _Excel Dynamic VIs.vi
  6. 右击Build Specifications»New»Application (EXE)
  7. 单击Source Files
  8. 添加 _Word Dynamic VIs.vi 或者 _Excel Dynamic VIs.vi 到 Always Included 窗口

LabVIEW 8.6 - 报表生成工具包1.1.3使用了LabVIEW类,因此更多的信息请参考相关的链接.

这些支持文件应该被包括,这样Word或者Excel就可以在EXE运行时被打开了。

如果上述的步骤没有解决问题,在 Application Builder中,单击 Advanced 并且使能 Pass all command line arguments to application这个选项



相关链接: Developer Zone Tutorial: Creating a Report in Microsoft Excel Using the LabVIEW Report Generation Toolkit
Product Manuals: LabVIEW Report Generation Toolkit for Microsoft Office User Guide
KnowledgeBase 3G5CDDV1: Error 7 When Running an .EXE Using VIs from Report Generation Toolkit for MS Office
KnowledgeBase 4TEK2GXK: Building an EXE in LabVIEW 8.6 using the Report Generation Toolkit

附件:





报告日期: 09/13/2004
最近更新: 10/22/2011
文档编号: 3DCF4P4P