LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Inconsistent Variant to Data Errors

Solved!
Go to solution

Sure. Sorry about that. The excel files are in previous posts.

0 Kudos
Message 11 of 15
(708 Views)

@PiDi wrote:

I can't check it now, so this is a pure guess:

 

Try putting additional time delay between Worksheet.Activate and executing VLookup.



For future reference with regards to this, there is actually a callback that you can capture from Excel when it's ready. So, I usually set a busy cursor, then unset it when I get this callback. This way you aren't guessing how long it will take before it's started up, because this can vary depending on your processor, if you just rebooted, what other work the PC is doing etc. I will find the exact callback once I get my code out of SCC

0 Kudos
Message 12 of 15
(704 Views)

Here's what I was suggesting in my previous post. I register for all Excel callbacks I want to register for in the VI shown at the bottom. The VI at the top is the VI that is called when a callback is received, which then fires an appropriate user event. I capture that event with my event structure.

 

Message 13 of 15
(698 Views)
Solution
Accepted by topic author buickgn

So I tested your code, and individually they work, like you said.  So I did the following:

test_sequence.png

 

And now I do not get the error on the variant.  

 

I haven't looked too deeply into this, but it looks like something in your VI's is not thread safe, so ensuring they don't run at the same time solves the problem.

 

I hope this helps.

Systems Engineer
SISU
Message 14 of 15
(686 Views)

Works perfect! Thanks Nathan!

0 Kudos
Message 15 of 15
(683 Views)