Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Will setting Saved = True in Workbook_Open have a negative effect?

I have an Excel 2000 workbook with a volitle function that is usually
only opened for viewing. To avoid getting prompted to save the
workbook when closing it, I find I can put the following code on the
workbook code page:

Private Sub Workbook_Open()
ThisWorkbook.Saved = True
End Sub

The volatile function evidently is called before the Workbook_Open
event fires, so it is possible to open and close the workbook without
being prompted to save. It seems to me that this is safe, in that if
any changes are made to the workbook after it is opened, the Saved
property will be set back to False, and the user will be prompted to
save. But since I am fairly new to programming VB and Excel, I would
like to know if I am overlooking any negative effects of including
this in a project.

TIA
Michael Purcell

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Will setting Saved = True in Workbook_Open have a negative effect?

You are correct that if any changes are made to the workbook (or the user
causes a calculation) excel would set the Saved property to false and the
user would be prompted.

I don't see anything detrimental in what you are doing although as I stated
above, any change made to the workbook would overcome; but the worst case
would be that the user is prompted to save. Others may have more expansive
thoughts.

--
Regards,
Tom Ogilvy

"Michael Purcell" wrote in message
...
I have an Excel 2000 workbook with a volitle function that is usually
only opened for viewing. To avoid getting prompted to save the
workbook when closing it, I find I can put the following code on the
workbook code page:

Private Sub Workbook_Open()
ThisWorkbook.Saved = True
End Sub

The volatile function evidently is called before the Workbook_Open
event fires, so it is possible to open and close the workbook without
being prompted to save. It seems to me that this is safe, in that if
any changes are made to the workbook after it is opened, the Saved
property will be set back to False, and the user will be prompted to
save. But since I am fairly new to programming VB and Excel, I would
like to know if I am overlooking any negative effects of including
this in a project.

TIA
Michael Purcell



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excell - two conditions count if factors are true when negative nu linda Excel Worksheet Functions 2 May 6th 10 03:02 PM
Function to return True/False if all are validated as True by ISNU Tetsuya Oguma Excel Worksheet Functions 2 March 15th 06 10:28 AM
Publish to Web, Zero Values setting not saved John Wilson Excel Programming 0 February 1st 04 03:10 AM
Setting Cancel = True in WorkbookBeforePrint Tony Excel Programming 0 December 21st 03 10:37 PM
error with setting "Items.Visible = True" Stan R Excel Programming 1 August 20th 03 09:51 AM


All times are GMT +1. The time now is 06:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"