ThisWorkbook.Saved = True does not work when Shapes().ControlFormat.Enabled = False

J

Joe HM

Hello -

I am trying to figure out why I cannot set the ThisWorkbook.Saved
values to True to avoid being prompted whether I want to save the
workbook upon exiting.

The code is doing the following ...

Workbook_Open()
Application.OnTime Now, "preProcess"
...

Public Sub preProcess()
If ThisWorkbook.ReadOnly Then

ThisWorkbook.Sheets("Sheet1").Shapes("Button1").ControlFormat.Enabled =
False
ThisWorkbook.Saved = True
End If
...

If I open the file in read-only and close it without making any
changes, I get the "Do you want to save changes ..." message.

All I want to do is to disable the button when the file is read-only.
How can I tell Excel that it should not care whether the button has
changed?

I use Excel 11 (2003) SP2.

Thanks!
Joe
 

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