View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default suppressing "do you want to save changes..."

I was eventually able to save my "addin data" file through code in another
workbook while "addin data" data was hidden.


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.

I wish I knew why this started happening


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.

--
Jim
"Ken" wrote in message
oups.com...
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



Jim Rech wrote:
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

--
Jim
"Ken" wrote in message
oups.com...
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