LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

I am looking for an automatic overwrite in ActiveX for MS Excel

I am trying to open a MS Excel spreadsheet add data and then save it. Currently I have to click a dialog box stating I want to overwrite the existing file. Is there a way to get around this or do it automatically.
0 Kudos
Message 1 of 2
(3,323 Views)
You may be getting this error because you are using the SaveAs function instead of the Save function. SaveAs will prompt you like this if the file exists, Save should not. If you use the function call,

Excel_WorkbookSave (hExcelWB, NULL);

where hExcelWB is the handle to the workbook you want to save, before you close Excel. That should eliminate the prompt.

Best Regards,

Chris Matthews
National Instruments
Message 2 of 2
(3,323 Views)