LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Automation open error

Solved!
Go to solution

HI , I faced an error while I try to open the excel program in labview, when I tried to run the program, I get the problem but when I delete the stack sequence then it become Ok , and I don't know why, cansomebody please help me.

 

Thanks

0 Kudos
Message 1 of 6
(3,075 Views)

I did not have a problem running your program as is

 

If I where you I would first wire all the error clusters in the order of which you want events to happenMake sure you are not closing a reference before you are done using itOn your machine you might still be trying to get the worksheet in excel but your LabVIEW code has moved on to closing a reference.

Brian
0 Kudos
Message 2 of 6
(3,044 Views)
Solution
Accepted by topic author williamlee1982

You don't have any of the error clusters wired, so if there's an error along the way you'll never know. A couple of glaring issues:

  • You are unnecessarily creating references which you already have. Specifically: you are using the Worksbooks.Application property to get the reference for the Excel application, which you already have. It's an input to the VI! 
  • You must close references in the opposite order in which you created them. Therefore you must use the error cluster to force a sequencing of closures. Your Close Reference functions have no such dependency, thus you cannot know ahead of time which one will execute first. 

 

I would suggest perusing the Excel thread for some examples on how to manipulate Excel via ActiveX.

Message 3 of 6
(3,038 Views)
Hi Brian and smercurio_fc I already know what's problem. Thanks for your help and your example. Have a great day.
0 Kudos
Message 4 of 6
(3,028 Views)

Hi,

Does anyone know how I can have the Automation Open vi. automatically save a new file?  I'm trying to auto-save a new file every second.

Thanks,

 

0 Kudos
Message 5 of 6
(2,915 Views)
That question doesn't really make any sense. Automation Open simply opens a reference to an object. It has nothing to do with saving of anything. If you want to save something at whatever period you want then you need to have a loop that runs at that rate and calls the Save method (or whatever it's called) for the class that you're accessing.
0 Kudos
Message 6 of 6
(2,912 Views)