Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro prompts to save the changes.....can i default it to yes

Status
Not open for further replies.

jeep2001

Programmer
Dec 15, 2005
134
US
I have an Excel macro that I run from Access.
It deletes a column in a spreadsheet...Before the delete takes place, there is a prompt "Do you want to save the changes..." . Is there a way in EXCEL to make this go away...
 
jeep2001,
from excel help:
DisplayAlerts Property Example

This example closes the workbook Book1.xls and doesn’t prompt the user to save changes. Any changes to Book1.xls aren’t saved.

Code:
Application.DisplayAlerts = False
Workbooks("BOOK1.XLS").Close
Application.DisplayAlerts = True
regards,
longhair
 
Can I force the changes to yes without user input in the macro?
 
jeep2001,
if i understand you correctly, now - you want to save the changes and not show alerts. correct?
then use the above code to disable the alerts and code the save.
search the help file for 'save' - i believe it is application.save or application.saveas.
regards,
longhair
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top