LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save then quit excel using activeX

The task that I need to do is open existing excel file, append data to the last row, save data then close it. Everything works fine except saving the data. I used property workbook note to save then invoke node to close a workbook then invoke node to quit excel application. I watched and see that the data is written to the sheet but when I closed it, it is not saved.

System: Window NT and Excel2000
Thank you
0 Kudos
Message 1 of 5
(3,639 Views)
Its kinda hard to diagnose the problem without seeing the vi, but I'll give it a shot. First I'm not sure how you could save it using a workbook property node, you need to use an invoke node. In the invoke node for a workbook there should be "save" and "save as" methods, try one of those and see if it works.

I ussually use a "save as" method in a worksheet invoke node and haven't had any problems.

Brian
0 Kudos
Message 2 of 5
(3,639 Views)
mai wrote:
>
> The task that I need to do is open existing excel file, append data to
> the last row, save data then close it. Everything works fine except
> saving the data. I used property workbook note to save then invoke
> node to close a workbook then invoke node to quit excel application.
> I watched and see that the data is written to the sheet but when I
> closed it, it is not saved.
>
> System: Window NT and Excel2000

Use Task Manager to check if Excel is still running.

I find that the programmatic close of Excel doesn't work. Excel is left
running until you actually quit either LabVIEW or the built app!

Side-effect: if you then launch Excel to view a document, the screen
isn't redrawn right.

Mark
0 Kudos
Message 3 of 5
(3,639 Views)
You should check for errors in the error cluster before save and close, if some kind of erro occurs, invoke and property nodes will simply pass it and won't do their work, so be careful with that. Also be sure you close al references after using them.
Hope this will point you in the right direction.
0 Kudos
Message 4 of 5
(3,639 Views)
Additionally- though it's been a while since I played with this and I don't
have time to refresh my memory;

I recall there is a property "Saved". Writing to this does not save the
workbook- it simply marks the workbook as having been saved so no requesters
appear on exit. This may be what's happening here.

Gorka Larrea wrote in message
news:506500000005000000CD2B0000-986697009000@quiq.com...
> You should check for errors in the error cluster before save and
> close, if some kind of erro occurs, invoke and property nodes will
> simply pass it and won't do their work, so be careful with that. Also
> be sure you close al references after using them.
> Hope this will point you in the right direction.
0 Kudos
Message 5 of 5
(3,639 Views)