LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange Excel Add Worksheet error

Solved!
Go to solution

I'm writing and reading an excel file with Labview. The code does exactly what I want, but after I read the excel file I get an unknown error in the 'Excel Add Worksheet' VI (from the Report Generation Toolkit). There are only 2 inputs and 2 ouputs available on this VI and I can't figure out why this error is popping up.

 

I write to the excel file with the next code:

 

1.gif

 

The functionblock inside the red square is giving the next error (after I try to write new data to the Excel file when I already read it):

 

2.png

 

As you can see the error is occuring in the VI because it's not present at probe 28. For reading the excel file I use the 'Excel Get Worksheet' and 'Excel Get Data' VI's also from the Report Generation Toolkit.

 

I want to be able to write to the excel file after reading it because I want to check the data inside Labview while doing the measurements. I hope someone can help me with this problem.

0 Kudos
Message 1 of 3
(2,424 Views)
Solution
Accepted by topic author Jakhals

At first sight nothing seems to be wrong in the displayed code. The error might be cause by something happening before this code section is executed (like if the report is closed). You said you are reading the Excel file but this part is not shown in your picture. Since you are using local variable to pass the report object a race condition may also be possible.

 

Ben64

0 Kudos
Message 2 of 3
(2,392 Views)

When I put the reading code inside the same loop to pass the local variable everything works just fine.. I should've thought of that, thanks!

0 Kudos
Message 3 of 3
(2,367 Views)