Error 7 While Deploying LabVIEW Executable

Updated Jun 3, 2019

Reported In

Software

  • LabVIEW
  • LabVIEW Application Builder Module
  • LabVIEW Report Generation Toolkit

Issue Details

When running an executable that uses VIs from the Report Generation Toolkit for Microsoft Office, I get the following error:

Error 7 occurred at Get LV Class Default Value. vi

Possible reason(s):

LabVIEW: File not found. The file might be in a different location or deleted. Use the command prompt or the file explorer to verify that the path is correct.  

 

This error is also shown in the following dialog box:



The VI successfully runs in the development environment in LabVIEW and there were no errors during the build process. Is there something I need to include in my build for this application to work?

Solution

This happens when the Report Generation Toolkit's dynamic VIs are not included during the build process. Follow the steps below based on your LabVIEW version to include the dynamic VIs during the build process:

LabVIEW 2014 and Later
When building applications with Report Generation VIs, you must complete the following additional steps:
  1. Add the following .lvclass file to the LabVIEW project:
    • If the application uses Microsoft Word, the file is located at C:\Program Files(x86)\National Instruments\LabVIEW x.x\vi.lib\Utility\NIReport.llb\Word\NI_Word.lvclass 
    • If the application uses Microsoft Excel, the file is located at C:\Program Files(x86)\National Instruments\LabVIEW x.x\vi.lib\Utility\NIReport.llb\Excel\NI_Excel.lvclass 
  2. In the My Application Properties dialog box of the Build Specifcations select the Source Files tab located on the left.
  3. Then navigate to and select the .lvclass files you added to the project. After selecting the files, click the right arrow button located next to the Always Included box to add the class files to the Always Included list. This will add the class to the application.
Note: If the application you are building contains the MS Office Report Express VI, you must add any Microsoft Word or Microsoft Excel templates that you use to the LabVIEW project and to the application. You can do this by adding the templates to the Always Included list under the Source Files tab of the My Application Properties dialog box.

LabVIEW 8.6 to 2013
Versions of the toolkit with LabVIEW 8.6 and later use LabVIEW classes, which dynamically call VIs depending on what report type is being generated. In order to build an executable that uses dynamically called VIs, you must include these VIs in your build specifications. 
  1. In your Project Explorer window, right-click on My Computer and select Add»Folder (Snapshot)
  2. Navigate to C:\Program Files\National Instruments\LabVIEW x.x\vi.lib\Utility\NIReport.llb or C:\Program Files(x86)\National Instruments\LabVIEW x.x\vi.lib\Utility\NIReport.llb (where x.x refers to the specific version of LabVIEW being used) and click Current Folder.
  3. Repeat the same procedure to add the LVClass folder by navigating to C:\Program Files\National Instruments\LabVIEW x.x\vi.lib\Utility\LVClass or  C:\Program Files(x86)\National Instruments\LabVIEW x.x\vi.lib\Utility\LVClass
  4. After you have the two folders in your LabVIEW Project, you can add them to the Always Included section of the Source Files category of the Build Specifications as in the picture below.



LabVIEW 8.0, 8.2, and 8.5 
  1. Application Builder only lets you add files from your project therefore you have to add this file to your Project Explorer first:
  1. Then you can add it as a dynamic VI inside the Application Builder: 
 
 

Note: If you are using the MS Office Report Express VI, you should include the template used by the Express VI in addition to your application. The configuration of the MS Office Report Express VI relies on a report template which is either a basic template provided in the LabVIEW templates directory or a custom template provided by the user. When an executable is created with the MS Office Report Express VI, the template must also be included as a support file in the Source Files tab. This will add the template to the "data" directory so that the executable will be able to call it upon execution of the program. 

LabVIEW 7.x
  1. Add the Word and Excel dynamic VIs in LabVIEW 7.x, click on the Source Tab in Application Builder and select Add Dynamic VI. 
    • If using Microsoft Excel, please include the path LabVIEW7.x\vi.lib\addons\_office\_exclsub.llb. A file dialog box should come up. Select _Excel Dynamic VIs.vi then click OK.
    • If using Microsoft Word, please include the path LabVIEW7.x\vi.lib\addons\_office\_wordsub.llb. A file dialog box should come up. Select _Word Dynamic VIs.vi then click OK
LabVIEW 6.x
When you build a stand-alone application or DLL that uses the LabVIEW Report Generation Toolkit 1.0, the support file directory containing _wordsub.llb and _exclsub.llb must be located in the same directory as the application or DLL and it must be in a subdirectory named Data (the default support file directory for the Application Builder). If Error 7 is still thrown when executing the application, _wordsub.llb and  _exclsub.llb need to be mass compiled to re-link their VIs. Mass compiling is done by selecting Tools»Advanced»Mass Compile.

Additional Information

Some additional troubleshooting steps include verifying:
  1. The path being written to matches the exact path on the computer; including spaces
  2. Both the Windows User and the Application (.exe) has read/write access and Administrator privileges
    • To set this privilege on your Application, you can right-click on your .exe file and select Run as Administrator
Sometimes after following these steps, a broken VI error will occur in the Report Generation Toolkit due to differences between versions of Microsoft Office. To resolve this, follow the steps in this article.

WAS THIS ARTICLE HELPFUL?

Not Helpful