LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Application crashes opening the Excel file

I built an application that needs to open an Excel file and read the data from. it works fine on my system, but when I run it on another PC, it crashes and give an error which I attached.

 

is it because of the version of the file?

0 Kudos
Message 1 of 11
(3,537 Views)

@parissa_wall3 wrote:

I built an application that needs to open an Excel file and read the data from. it works fine on my system, but when I run it on another PC, it crashes and give an error which I attached.

 

is it because of the version of the file?


I don't see any graphic file showing the error in the zip file you included.

 

0 Kudos
Message 2 of 11
(3,499 Views)

I have found using ActiveX for Excel automation unreliable at best due to differences in Windows, ActiveX, and Excel versions.

 

This forum and the Idea Exchange is full of examples that read and write Excel files through ActiveX and I have tried many of them

 

They all might work flawlessly on one computer and never work on another seemingly identical computer. 

 

I have been looking at XLR8 Excel Toolkit and it looks promising since it does not require Excel to be installed on the target machine and does not use ActiveX automation.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 11
(3,483 Views)

Here is the error. 

0 Kudos
Message 4 of 11
(3,468 Views)

Yup that's the error I always got.

 

I even workd with a NI engineer for several days trying to figure out why it works fine on one computer but another computer gives that error.

 

We never figured it out and we have abandoned this method of Excel automation

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 11
(3,465 Views)

You appear to be running LabVIEW 2014.  Do you have the Report Generation Toolkit (included automatically with LabVIEW 2014 Professional)?  If so, it is a whole lot easier to use, it (mostly) works, and it does not require you to use ActiveX, which I believe even Microsoft has abandoned.  If you do have the toolkit, please try it, it will make your programming a lot easier (and result in many fewer errors).

 

Bob Schor

0 Kudos
Message 6 of 11
(3,438 Views)

I have 2014 and I have report generation toolkit for the next 30 days.Does the toolkit it have a read from Excel option? for some reason I couldnt find it.

0 Kudos
Message 7 of 11
(3,429 Views)

@parissa_wall3 wrote:

I have 2014 and I have report generation toolkit for the next 30 days.Does the toolkit it have a read from Excel option? for some reason I couldnt find it.


If you are workign with demo software then you might as well use the XLR8 Excel Toolkit I recomended before.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 8 of 11
(3,414 Views)

Open the Report Generation Toolkit.  Find "New Report", and look at its Help.  Do you notice the required Report Type input?  One of the options is Excel.

 

This would be a very good time to mention that there are Examples and Tutorials out there that will show you the basics.  I wrote one myself, but have always had a problem linking to it ... let me see if I can find it.  Hmm, if you search here for Revised "Generate Excel Report" Example (the quotes are part of the title), you'll find my revision, fully commented, of the Generate Excel Report that ships with LabVIEW.

 

Bob Schor

0 Kudos
Message 9 of 11
(3,404 Views)

thanks for the solutions, I tried the XLR8 Excel Toolkit , It looks solid, but when I run my program it gies me this error:

 

rror 1172 occurred at Invoke Node , (System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
Inner Exception: System.NullReferenceException: Object reference not set to an instance of an object.)

 

LabVIEW: A .NET exception occurred in an external assembly. For information about correcting this error, copy the following exception (in bold), and search the Microsoft Developer Network (MSDN) Web site or the Web for a possible explanation.
System.NullReferenceException in XLR8.lvlib:Read Area (String).vi->Main EPL Task.vi

0 Kudos
Message 10 of 11
(3,360 Views)