Disable Do you want to save changes

  • Thread starter Thread starter sb1920alk
  • Start date Start date
S

sb1920alk

For workbooks that are accessed only through a web page (like a custom
calculator) where there is no need to save changes, how can I skip clicking
No every time I close the page?

I've tried: If ThisWorkbook.ReadOnly Then ThisWorkbook.Saved = True

but it doesn't work when the file is online.

Thanks in advance,
 
I don't have an online workbook to test with right this minute, but you might
try doing a similar test, but checking the first 4 characters of the full
path to the workbook to see if they are http -- if so, you know it's on some
web page, then you could set the .Saved property to true?

As I said, untested, kind of spitballing here.
 
Well, I tried:

If Left(ActiveWorkbook.FullName, 4) = "http" Then ThisWorkbook.Saved = True

and it still asks of I want to save the changes. Even with just:

ThisWorkbook.Saved = True

and no conditions it still asks.

Everything works fine when the file is opened directly through Excel. I'm
only having this issue when it's viewed online. I think it might be something
with Internet Explorer, but I can't find any options to disable it there
either.

If it helps, this is the full message:

This document has been modified. Do you want to save changes?

Yes: Saves your changes
No: Discards your changes
Cancel: Keeps this document open
 

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

Back
Top