suppressing "do you want to save changes..."

K

Ken

I recentely started to get prompted "Do you want to save the changes to
*.xls?" regardless of whether or not I made any changes. I have many
users who now receive the prompt for files that they did not even know
they had opened. Those are hidden files that contain code and data
that are opened via an add-in that I wrote and people have used for
years without even being aware the hidden files even existed. I believe
this just started happening with a server upgrade (to 2003). Does
anyone know of a setting somewhere that could be set to always prompt
for saving changes, even when no changes were made? Or, alternatively,
is there something I could put in the code to suppress that warning on
certain files?

Thanks

Ken
 
J

Jim Rech

If you know, absolutely, that you never want a user to be prompted to "save
changes" add this code to the ThisWorkbook module of the workbook:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Saved = True
End Sub
 
I

Incidental

Hi

You could try either

Application.DisplayAlerts = False
ActiveWorkbook.Saved = True

in your workbookclose event

s
 
K

Ken

Thanks Jim and s

saved=true in the before close event takes care of most of my problem.
It took me a little while to get a hidden file saved with that code in
it, but, I was eventually able to save my "addin data" file through
code in another workbook while "addin data" data was hidden.

I wish I knew why this started happening. All Excel files on one
particular server trigger the "save changes" prompt, regardless of
whether or not there have been changes.

Thanks

again.

Ken
 
J

Jim Rech

I was eventually able to save my "addin data" file through code in another
I find the easiest way to save a workbook that is hidden is in the VBE.
Select the workbook in the VBE's Project Explorer and then click the Save
button on the VBE Standard toolbar.

You didn't add any volatile functions like NOW or OFFSET or INDIRECT, did
you? They are always automatically calced when a workbook that has them is
opened. So Excel thinks changes have been made.
 
K

Ken

Jim
Saving in VBE is good to know. Thanks again.
There has definitely not been a change to my addin data file, as it has
been opening, not visible, and closing without people knowing about it
for years. That is the file that has triggered all the calls since
users are prompted to save something they don't know they have open.
It happens on every file on one particular server and not on the
others, and it just started in the last week. Thre must be a setting
somewhere that says to bother people about saving files that don't need
to be saved.
Thanks
Ken
 

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