q; workbook save and close

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In excel macro;
1. How can I make this? save as overwrite, without save dialog box
ActiveWorkbook.SaveAs Filename:=myFile, FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False


2. How can I make this? close it without saving and asking confirmation?
myWorkbook.Close
 
Add a couple of lines:

application.displayalerts = false
'your code to save
application.displayalerts = true

and tell excel how to close your file:

myWorkbook.close savechanges:=true 'false????
 
Back
Top