Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Closing worksheets without saving them

  Asked By: Adelina    Date: Nov 15    Category: MS Office    Views: 786
  

Just wondering how can I close a worksheet without saving it in Excel
Macro? Also, how can I name a newly opened Excel work book using Excel
Macro?

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Gregg Bennett     Answered On: Nov 15

Call ActiveWorkbook.Close(SaveChanges:=False)

You don't name an Excel workbook. You name the file you save it to.

 
Answer #2    Answered By: Madiha Malik     Answered On: Nov 15

Here is the code to close  without saving
ActiveWorkbook.Close False
and,
To save newly open excel  sheet with name
ActiveWorkbook.SaveAs Filename:="Your Desired Name"

 
Didn't find what you were looking for? Find more on Closing worksheets without saving them Or get search suggestion and latest updates.




Tagged: