Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default 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
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
Before Close Event Hide all Worksheets then Close Application RyanH Excel Programming 0 January 24th 08 03:15 PM
Can I stop the close method in an auto close macro Paul Excel Programming 2 November 17th 06 02:48 PM
In Before Close Sub ActiveWorkBook.Close(False) repeat procedure [email protected] Excel Programming 5 September 26th 06 03:11 PM
Excel shoud not close all active books when clicking close button technomike Excel Discussion (Misc queries) 0 June 10th 05 05:35 PM
excel - Windows close button (x) should only close active workboo. CoffeeAdict Setting up and Configuration of Excel 3 February 8th 05 04:30 AM


All times are GMT +1. The time now is 07:58 PM.

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

About Us

"It's about Microsoft Excel"