Annoying dialogue

T

The Wolf

When I try and close my workbook it beeps and asked me if I want to save
changes.

I DIDN'T MAKE ANY CHANGES.

How do I make this go away?
 
B

Bernard Rey

The Wolf wrote :
When I try and close my workbook it beeps and asked me if I want to save
changes.

I DIDN'T MAKE ANY CHANGES.

How do I make this go away?

There must be some changes. Not necessarily important changes, and they
probably are automatic. If you have some auto-launch macro, or if you have
one that launches when printing or so, Excel WILL consider it as a change.

Find out the reason, and then you may find the cure.

One way to avoid the message could be to autosave the workbook (if you want
it) or to use the
ThisWorkbook.Saved = True

VBA instruction at some point to avoid being asked.

But well, depending on the reason, there may be different answers...
 
J

JE McGimpsey

The Wolf said:
When I try and close my workbook it beeps and asked me if I want to save
changes.

I DIDN'T MAKE ANY CHANGES.

How do I make this go away?

Any volatile function will automatically cause a change that triggers a
save message. Volatile functions include:

NOW(), TODAY(), RAND(), INDEX(), OFFSET(), INDIRECT(), INFO(),
CELL()
 
T

The Wolf

The Wolf wrote :


There must be some changes. Not necessarily important changes, and they
probably are automatic. If you have some auto-launch macro, or if you have
one that launches when printing or so, Excel WILL consider it as a change.

Find out the reason, and then you may find the cure.

One way to avoid the message could be to autosave the workbook (if you want
it) or to use the
ThisWorkbook.Saved = True

VBA instruction at some point to avoid being asked.

But well, depending on the reason, there may be different answers...

The reason must be the Today()

What I would LIKE to do is auto save on close without dialogue. Is there a
way to do that?
 
B

Bernard Rey

The Wolf wrote :
The reason must be the Today()

What I would LIKE to do is auto save on close without dialogue.
Is there a way to do that?

Yes. Paste the lines hereunder in the "ThisWorkbook" code sheet :

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Save
End Sub

Each time you'll close the workbook, it'll be automatically saved.

You'll access the "ThisWorkbook" code sheet in the Visual Basic Editor, by
doble clicking on the corresponding "ThisWorkbook" icon in the "Projects"
window on the left.
 
T

The Wolf

The Wolf wrote :


Yes. Paste the lines hereunder in the "ThisWorkbook" code sheet :

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Save
End Sub

Each time you'll close the workbook, it'll be automatically saved.

You'll access the "ThisWorkbook" code sheet in the Visual Basic Editor, by
doble clicking on the corresponding "ThisWorkbook" icon in the "Projects"
window on the left.

Thank you Bernard!

That's quite a Rube Goldberg way to save a file. Kinda makes you appreciate
the Macintosh!
 

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