Unexpected .Saved=False

D

DocBrown

I have a workbook that when I open the file and immediately close it, I get
the 'Do you want to save' msgbox.

I insured that the auto_open was disabled. When the file is opened it seems
to have the .Saved property always set to False. I tried to hold the shift
when I open it, same behavior.

What can I check to determine why? I can't figure out what is causing this.

Thanks,
John
 
D

DocBrown

That just hides the issue. I want to know why it is occuring and fix the root
cause. What if the property that is causing .Saved to go False is something I
need to know about.

I have another template/workbook set that has very similar structure and
macros and it doesn't do this. I can't determine the difference.

John
 
D

DocBrown

Ok, I've done more testing...

If I do the shift-open to inhibit macros and go into VBA, The immediate
window gets:
?workbooks("CDM_Account1.xls").Saved
False

If I enable my auto_open macro and have this as the first executable liine:

Debug.Print "AutoOpen Enter: Saved=" & ThisWorkbook.Saved
displays this:
AutoOpen Enter: Saved=False

If I go to Tools->Options... Calculation and set Calculation=manual the
problem goes away. My workbook won't work as I want it if I turn that off,
though.

Any idea wWhat types of forumula will trigger this? I'll keep debugging the
forumulas....

John
 
H

Halim

hi,
that occure when some changes happen before debug.print book.saved
try to check whether you have another code which change part of your book.
 
D

DocBrown

Hi Charles,

Yup, you nailed it. I have the following formulas:
=IF($J$7 <>"",$J$7,NOW())

and

=OFFSET(O16,-1,0)+M16-N16

The first one just fills in a date column from a field in a header area. The
second automatically calculates a running balance when expenses are entered
in M and payments are entered in N. I did the running balance this way
because I couldn't figure out a way to make this work when the user inserts
new rows. It's not perfect because the user still needs to do a fill down to
populate the inserted rows because Excel does not propagate the formulas when
rows are inserted.

Is there another way to calulate a running balance that won't trigger the
volitile and where the user can still insert rows?

John
 

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