Stop "save changes" message appearing

D

DJ Dusty

During a macro, I close a workbook, but get the "do you want to save
changes" message appearing, even though I only opened said workbook
purely to copy some cells to another workbook. I didn't -make- any
changes!

It is crucial that the macro does not halt so that the "save changes"
message appears, so how do I stop it happening???

Thanks!
 
C

Chip Pearson

Some functions like NOW will cause the workbook to calculate on
opening, and thus your workbook will be changed. To close the
workbook without saving changes, use


Workbooks("Whatever.xls").Close savechanges:=False


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com





"DJ Dusty"
message
news:D[email protected]...
 

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