Close worksheet, dont save

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
 
G

Guest

Hi jb,

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

Regards,

OssieMac
 
G

Guest

cheers, OssieMac

works a treat!

jb

OssieMac said:
Hi jb,

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

Regards,

OssieMac
 

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

Top