LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

making an event structure based on excel files

hello,

I am pretty new to labview and I am trying to add an event to someone else's code. I want to say "when certain excel file is read, add this specification". When I looked at the options for events I saw that you could do a 'value change' but I need it to be when a certain file is read.  I cannot post any code but if someone could give me a general explanation that would help.

Thanks all

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

This is one of those times a User Event comes in handy.

 

This example is obviously not ready for prime time but should give you an idea of how to start

!1.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 5
(2,497 Views)

Your application is using either ActiveX or .NET to interface to Excel. The Excel API exposes certain properties, functions and events you can use in your application.

 

Depending on the situation you want to react on, there is either an exposed event or you have to poll the property. If the event is exposed, you wouldn't use the event structure in your LV code, but you would "register for event" and define a callback VI there.

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 5
(2,493 Views)

Thank you for the help, but I am a little confused still. I am fairly certain Activex is used but I cannot find where the differentiation between excel files is made in the code. So basically I do not know if the information I need is given or if I have to extract it like you said. I do not know how to extract the ref num or how to reference the file. Sorry that my understanding is so basic. 

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

I'm not certain I understand your question.  If you have code that opens and reads Excel, and want to "do something" when that happens, simply put the "do something" code wired right after the "open and read Excel" code (if you put everything into a sub-VI, you can have a "Read Excel" sub-VI followed by a "Do Something" sub-VI, connected by wires to enforce Data Flow.

 

On the other hand, if you are asking "How do I open and read Excel spreadsheets in LabVIEW", the answer is "Use the Report Generation Toolkit", which hides most of the pain and horror from you.  And it even works!

 

BS

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