ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SaveAs method (https://www.excelbanter.com/excel-programming/271452-saveas-method.html)

L Buchy

SaveAs method
 
I am trying to automate a spreadsheet that uses DDE links to get data & save
it out to a comma delimited file to import into Access & would like this to
be seamless to the user (not having to respond to any messages).

I am using the SaveAs method in the BeforeClose event of the Workbook.
Actual code is:
ActiveWorkbook.SaveAs FileName:="e:\shift Report\report\xtest",
FileFormat:=xlCSVWindows

This code works fine & it saves this file, but after this happens & Excel is
being closed I get the standard message "File is not in Microsoft Excel 97
format. Would you like to save?" How can I bypass this message so the user
does not have respond to this message??



John Green[_2_]

SaveAs method
 
Add the following code to the end of your macro that flags that the workbook does not need saving.

ActiveWorkbook.Saved = True

When the user closes the workbook, assuming no further changes have occurred, there should be no prompt for saving.


--

John Green - Excel MVP
Sydney
Australia


"L Buchy" wrote in message ...
I am trying to automate a spreadsheet that uses DDE links to get data & save
it out to a comma delimited file to import into Access & would like this to
be seamless to the user (not having to respond to any messages).

I am using the SaveAs method in the BeforeClose event of the Workbook.
Actual code is:
ActiveWorkbook.SaveAs FileName:="e:\shift Report\report\xtest",
FileFormat:=xlCSVWindows

This code works fine & it saves this file, but after this happens & Excel is
being closed I get the standard message "File is not in Microsoft Excel 97
format. Would you like to save?" How can I bypass this message so the user
does not have respond to this message??






All times are GMT +1. The time now is 12:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com