LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error Saving File with MS Office Report Express VI


@Bob_Schor wrote:

Here are some comments and suggestions (sort of "How I Do It" and things you might try):

  • To be honest, I'm not 100% certain I understand the difference (to Excel) of an Excel Template (.xltx) and an Excel Spreadsheet (.xlsx).  I do not use Excel Templates -- if I want to read an Excel Spreadsheet (.xlsx) file, getting data from rows and columns, I wire the .xlsx file into the New/Create Report "Template" input.  If I'm "updating" a file (both reading and writing the same file), I need to wire the Path to the Save Report function, as well.  It has always worked for me.  You might try using a Spreadsheet File as your Input file and see if that makes any difference.

The express VI "MS Office Report" requires that the template format be .xltx. 

 


@Bob_Schor wrote:
  • When you build an Executable, you get a Data folder placed at the same level as your .EXE.  I use this as the starting location for any Data Files I need to read or write in my Application.  Here's a Snippet of code that I use to find the path to the Data Folder in my Executable:Data Folder.png  The Green folder is an OpenG utility that creates the Folder if it is not present (you probably don't need this, I'm just being Super-Careful) (I think that such a function, to create a possibly-nested directory, may have been included in LabVIEW 2019 -- yes, there's now Create File and Containing Folders, and Create Directory Recursive).
  • The trick to making this work is to also have a Data Folder as a "top-level Folder" in your Project Folder.  When you are in Development Mode, the Application Directory is the Project Folder, and when you are in Execution Mode, it is the folder you specify on the first page of the Build Spec (I like to use the Public Documents folder as the place LabVIEW puts its LabVIEW Builds folder, as all the Users can access it, but it is not, by default, "visible").

I tried saving the report to the "Data" folder within the application directory and experienced the same fatal crash as before.

0 Kudos
Message 11 of 17
(645 Views)

It's not 64 bit Windows that's the problem, it's 64 bit Office, which is a fairly recent change (I had issues with 2016 as well). My dev machine had 2013 and the lab had 2016, and it wouldn't work.

 

Regarding debugging, you can see the BD of a built executable if you follow these steps:

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000PAiTSAW

 

0 Kudos
Message 12 of 17
(644 Views)

Ah ok, I just looked and the Office 365 on the Dev computer was 32 bit, same as on the Lab computer with Office 2016.

 

I'll look into that remote debugging here shortly.

0 Kudos
Message 13 of 17
(641 Views)

Good to know.

 

For future Googler's of this problem, Office 365 now installs 64-bit Office by default. See this article for info on how to install it as 32 bit:

 

https://support.office.com/en-us/article/choose-between-the-64-bit-or-32-bit-version-of-office-2dee7...

 

 

By the way, here's another thread where the author seems to be able to create files, but has errors upon saving them: https://forums.ni.com/t5/LabVIEW/Save-Report-to-File-Report-Generation-Toolkit-isn-t-actually/m-p/38...

 

He never replied so I don't know how it turned out.

 

Also, as a further resource of people with general issues with the Report Generation Toolkit, see this knowledgebase article: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019N7CSAU&l=en-US

 

OP, that third link may help you out if you can get remote debugging working. Maybe not, but worth a try. That's what fixed my original RGT problems.

0 Kudos
Message 14 of 17
(629 Views)

That second link is discussing "Save Report to File" which the MS Office Report Express VI uses (I discovered that after converting to a regular VI and diving into the block diagram), but the troubleshooting posed in that thread did not fix my issue, and as you mentioned, there was not a solution.

 

I used that third link approximately 6 months ago to relink the broken invoke node, because the dev computer has Office 365 on it, and required that fix, but that gave me an idea here.  Could that invoke node now be "configured" for use with Office 365, so the deployed code is incompatible with office 2016 on the Lab PC?  I saved the subVIs associated with the MS Office Report Express VI so that every time I used it on the dev computer, it didn't import as "broken", but even if I could revert those files back to how they were originally, the dev computer would show as "broken" so it wouldn't allow a build...

0 Kudos
Message 15 of 17
(612 Views)

I have this exact problem.

I build the exe and install on my main PC with office 365.  When I try to install and run the exe on the lab Excel 2016 PC I get the exact same exception error.

I am using Labview 2019 32 bit.  I installed the devopement system on the lab PC and the raw code works.

Can the exe code be made compatible with both excel versions by adding something to the exe or install source files?

0 Kudos
Message 16 of 17
(495 Views)

I broke down and installed office 365 on the lab computer.

This fixed the problem.

0 Kudos
Message 17 of 17
(486 Views)