Close worksheet, dont save

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

Guest

i have a macro in file A that opens file B , copies some data from it, pastes
it to file A, then closes file B.

when it closes file B, i dont want it to save changes.

i can find the command that WILL Save it (ActiveWorkbook.Save), & am
currently using the command to not save it (ActiveWorkbook.Close), however it
always brings up the "Do you want to save changes?" tick box in the middle of
the macro.

how do i get round this? is there a command to say 'close, no changes'?

cheers


jb
 
Hi jb,

Application.DisplayAlerts = False
Workbooks("BOOK1.XLS").Close
Application.DisplayAlerts = True

Regards,

OssieMac
 
cheers, OssieMac

works a treat!

jb

OssieMac said:
Hi jb,

Application.DisplayAlerts = False
Workbooks("BOOK1.XLS").Close
Application.DisplayAlerts = True

Regards,

OssieMac
 
Back
Top