LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 7 in standalone application

Searched lots of forums and unsuccessfully implemented solutions accordingly on this so I'm turning to a post of my own.

I have a custom excel template that I am trying to use to generate a report using the MS Office Report Express VI on a deployed stand-alone application.  The application directory that the .exe and all dependent files (subvi's, and the excel template itself) are read from (built to) a subfolder of a company network drive.  I am trying to write the report to a different subfolder of the same company network drive.  The computer on which the .exe runs has read and write access to both subfolders.  I have included NI_Excel.lvclass, NIReport.llb, and LVClass to the project and added them to the "Always Included" section of the Source Files as instructed by this forum post and this Knowledge Article.  When I originally included the MS Office Report Express VI, it was originally broken, but I fixed it according to the steps in this Knowledge Article.  I run the .exe as an administrator (I get a different error about access violation if it is not run as an administrator).  Inside the MS Office Report Express VI, the path to template is pointing towards the standalone application directory, where the template resides.  

 

When I get to the point in the program where the Express VI is called, I get:
"Error 7 occured at Open/Create/Replace File in NI_Excel.lvclass: Save Report to File.vi->NI_ReportGenerationToolkit.lvlib:subMS Office Report Block.vi -> Main.vi:MS Office Report.vi->Main.vi" (Main.vi is my main VI and the MS Office Report Express VI is not within any subVIs, it is placed directly in the main 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.
Company_Network_Drive:\write_sub_folder (this is the destination that I have set as the "Path to Save Report" input for the MS Office Report Express VI)

 

I noticed that in the application directory after the program is built and deployed, the LVClass, NI_Excel.lvclass and NIReport.llb files are not present, despite the fact that they are in the "Always Included" field of the Source Files of the program build.  Should those files be visible in the application directory?  Could there be something else that is broken about that subvi that is not causing a broken run arrow, but still causes the error 7?  Am I missing something else entirely?


I apologize for the lack of code and I have provided as much detail as I can while retaining the proprietary information of the work I am doing.  Any suggestions on new things to try would be much appreciated.

 

0 Kudos
Message 1 of 5
(2,909 Views)

Searched lots of forums and unsuccessfully implemented solutions accordingly on this so I'm turning to a post of my own.

I have a custom excel template that I am trying to use to generate a report using the MS Office Report Express VI on a deployed stand-alone application.  The application directory that the .exe and all dependent files (subvi's, and the excel template itself) are read from (built to) a subfolder of a company network drive.  I am trying to write the report to a different subfolder of the same company network drive.  The computer on which the .exe runs has read and write access to both subfolders.  I have included NI_Excel.lvclass, NIReport.llb, and LVClass to the project and added them to the "Always Included" section of the Source Files as instructed by this forum post and this Knowledge Article.  When I originally included the MS Office Report Express VI, it was originally broken, but I fixed it according to the steps in this Knowledge Article.  I run the .exe as an administrator (I get a different error about access violation if it is not run as an administrator).  Inside the MS Office Report Express VI, the path to template is pointing towards the standalone application directory, where the template resides.  

 

When I get to the point in the program where the Express VI is called, I get:
"Error 7 occured at Open/Create/Replace File in NI_Excel.lvclass: Save Report to File.vi->NI_ReportGenerationToolkit.lvlib:subMS Office Report Block.vi -> Main.vi:MS Office Report.vi->Main.vi" (Main.vi is my main VI and the MS Office Report Express VI is not within any subVIs, it is placed directly in the main 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.
Company_Network_Drive:\write_sub_folder (this is the destination that I have set as the "Path to Save Report" input for the MS Office Report Express VI)

 

I noticed that in the application directory after the program is built and deployed, the LVClass, NI_Excel.lvclass and NIReport.llb files are not present, despite the fact that they are in the "Always Included" field of the Source Files of the program build.  Should those files be visible in the application directory?  Could there be something else that is broken about that subvi that is not causing a broken run arrow, but still causes the error 7?  Am I missing something else entirely?


I apologize for the lack of code and I have provided as much detail as I can while retaining the proprietary information of the work I am doing.  Any suggestions on new things to try would be much appreciated.

0 Kudos
Message 2 of 5
(2,908 Views)

Hi Ryan,

 

Company_Network_Drive:\write_sub_folder (this is the destination that I have set as the "Path to Save Report" input for the MS Office Report Express VI)

  • Do you really have a drive with the name "CompanyNetwork_Drive:"? That's rather unusual for a Windows system…
  • Even when that drive exists you only specify a folder, but no filename…

 

I apologize for the lack of code and I have provided as much detail as I can while retaining the proprietary information of the work I am doing.

You should be able to show atleast an example how you are attempting to save your data to a report file. The part on filename/path generation is important here!

Nobody says you need to attach your "proprietary" code, but you should show an example VI which generates the very same error you encountered…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 5
(2,902 Views)

@GerdW wrote:

 

Nobody says you need to attach your "proprietary" code, but you should show an example VI which generates the very same error you encountered…


And of course in doing so, you're likely to find\solve the problem. It's the nr. 1 thing to do when there's any problem: simplify.

0 Kudos
Message 4 of 5
(2,889 Views)

Also make absolutely sure the path you're saving to is valid. If that path is relative to a VI, it's likely to be wrong in the exe.

 

I'd start with a popup messagebox to display the path (using path to string). It's usually the quickest way.

 

Or replace the report generation with a text file. See if that works. If it gives the same error, it's not the report generation.

0 Kudos
Message 5 of 5
(2,888 Views)