Thread: SaveAs method
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
John Green[_2_] John Green[_2_] is offline
external usenet poster
 
Posts: 58
Default 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??