SaveAs method

L

L Buchy

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??
 
J

John Green

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top