ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Disable Do you want to save changes (https://www.excelbanter.com/excel-discussion-misc-queries/188437-disable-do-you-want-save-changes.html)

sb1920alk

Disable Do you want to save changes
 
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,

JLatham

Disable Do you want to save changes
 
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.

"sb1920alk" wrote:

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,


sb1920alk

Disable Do you want to save changes
 
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

"JLatham" wrote:

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.

"sb1920alk" wrote:

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,



All times are GMT +1. The time now is 04:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com