Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modify on close
I need to have the status of a workbook changed to modified even though a
user has not made any changes. Is there a way to do this so when the user opens and views the file its status automatically changes? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modify on close
add this to the thisworkbook module
Private Sub Workbook_Open() ThisWorkbook.Saved = False End Sub -- Gary "acss" wrote in message ... I need to have the status of a workbook changed to modified even though a user has not made any changes. Is there a way to do this so when the user opens and views the file its status automatically changes? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modify on close
I thought of doing as Gary suggests, but the user could choose not to save
changes at the close, so the modified date wouldn't change. I also thought of change the BuiltInDocumentProperties("Time Last Saved") in the BeforeClose event, but that's a change to the workbook and is only kept if the user saves. I don't think there is any way to guarantee showing it as saved without saving it. So you can save it in the WorkBook_Open or the WorkBook_BeforeClose module. The first will not save any changes that the user makes later. The second will save their changes but will show the saved time as the time when they closed the workbook, which is maybe what you want judging from the title of this post. These are workbook level events, so you need to paste the one you choose into the ThisWorkbook module. Private Sub Workbook_Open() Me.Save End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) Me.Save End Sub hth, Doug "acss" wrote in message ... I need to have the status of a workbook changed to modified even though a user has not made any changes. Is there a way to do this so when the user opens and views the file its status automatically changes? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modify on close
Thanks Doug,
The idea is that i want to track when a user opens the workbook. I am using sharepoint and it only alerts me when a change has been doen to the file but i want to be alerted as to when someone actually opens the workbook...can this be done??? "Doug Glancy" wrote: I thought of doing as Gary suggests, but the user could choose not to save changes at the close, so the modified date wouldn't change. I also thought of change the BuiltInDocumentProperties("Time Last Saved") in the BeforeClose event, but that's a change to the workbook and is only kept if the user saves. I don't think there is any way to guarantee showing it as saved without saving it. So you can save it in the WorkBook_Open or the WorkBook_BeforeClose module. The first will not save any changes that the user makes later. The second will save their changes but will show the saved time as the time when they closed the workbook, which is maybe what you want judging from the title of this post. These are workbook level events, so you need to paste the one you choose into the ThisWorkbook module. Private Sub Workbook_Open() Me.Save End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) Me.Save End Sub hth, Doug "acss" wrote in message ... I need to have the status of a workbook changed to modified even though a user has not made any changes. Is there a way to do this so when the user opens and views the file its status automatically changes? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Before Close Event Hide all Worksheets then Close Application | Excel Programming | |||
Can I stop the close method in an auto close macro | Excel Programming | |||
In Before Close Sub ActiveWorkBook.Close(False) repeat procedure | Excel Programming | |||
Excel shoud not close all active books when clicking close button | Excel Discussion (Misc queries) | |||
excel - Windows close button (x) should only close active workboo. | Setting up and Configuration of Excel |