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

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

Similar Threads

Backing Up Workbooks 2
Simplify save code 11
Save-As Macro 2
save & backup file 2
Save with ref. to cell A1 2
Maxcro questions 2
Saving a workbook to an iKnow portal 2
Macro that revealed some password 3

Back
Top