Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

save excel file

Hi
I have a code for openning an excel file, read it, then close it. The problem is, when I close it, it prompts a window asking if I want to save change to the excel file that I opened. Is there a way to default it to not save changes? Also I wonder why it ask me if I wanna save change while I just read data from the excel file without writing anything to it.

What I did in my program is
1. open application by using invoke node
2. open book by using invoke node
3. open sheet by using invoke node
4. then read data.
5. close sheet ref num by using close reference function
6. close book ref num by using close reference function
7. quit application by using invoke node
8. then close application ref num by using close reference function

Thanks
0 Kudos
Message 1 of 3
(3,443 Views)
Hi,

Excel is probably taking note of where the file pointer (active cell) is at time of close...if it isn't in the same location Excel prompts for a save. I don't know which version of Excel you have...but look to see if there is a way in excel to suppress that prompt.

cheers,
-Brett
0 Kudos
Message 2 of 3
(3,429 Views)
It could be that the workbook was created in another version of Excel. Excel will alway re-calc a workbook that is not the current version. Try saving the file locally to see if the problem disappears. Otherwise, there are three easy ActiveX solutions you can implement:

1. Set the File Open option Read-only to True
2. Set the Close Workbook option SaveChanges to False
3. Set the Workbook property Saved to True before closing
Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.1, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
0 Kudos
Message 3 of 3
(3,412 Views)