05-13-2015 04:05 PM
I specifically want to be able to programmtically save and close an open excel workbook that has not yet been saved and I don't know the name of. From Labview.
I know how to manipulate workbooks that I open from a saved location, but don't know how to take whichever workbook is open on my computer and save it to a known location.
Thanks!
I saw this post and thought there might be a similar method for ActiveX objects that there is for vi's:
Solved! Go to Solution.
05-13-2015 05:58 PM
The question you want to ask is whether Excel provides a method to list all open documents. See if the Application.Workbooks property gets you what you need.
05-14-2015 09:37 AM
If you have the Report Generation Toolkt, the Excel Advanced pallette has a VI called "Excel Get ActiveX References". It returns the Application, Workbook, Worksheet, Sheets and Shapes.
05-14-2015 03:05 PM - edited 05-14-2015 03:11 PM
@DaveRines wrote:
I specifically want to be able to programmtically save and close an open excel workbook that has not yet been saved and I don't know the name of. From Labview.
I know how to manipulate workbooks that I open from a saved location, but don't know how to take whichever workbook is open on my computer and save it to a known location.
Thanks!
I saw this post and thought there might be a similar method for ActiveX objects that there is for vi's:
This should work:
If you want to change the path or have more control on the options, you could replace the '_Workbook/Save' method with
In this case, if you want to avoid additional pop-ups, make the 'Visible' and 'DisplayAlerts' properties FALSE when you open the Application in the first ActiveX node
05-18-2015 11:08 AM
Thanks for trying, but that's not quite enough info to get me there. To use that function you still need the report reference which is what I'm looking for.
05-18-2015 11:10 AM
This worked. Here's a slightly tweaked version that worked for me. Thanks for the help!