Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Timestamp Saved
I have the following code:
Private Sub Workbook_Open() Worksheets(1).Range("A1").Value = Now() End Sub This shows current date and time but i only need it to change if workbook is modified. This code will be within a workbook that is sent from one country to another and needs to maintain its orginal timestamp.Can this be done? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Timestamp Saved
But if the user chooses to close without saving, then the change in the
workbook_open event will be lost. If the user chooses to save, then your change is kept. If you don't want your change to mark the workbook as "dirty" (changed without being saved), you could use: Private Sub Workbook_Open() me.Worksheets(1).Range("A1").Value = Now me.saved = true End Sub Then the user won't be prompted to save because of this change. But any other change will cause the prompt to show up. jk wrote: I have the following code: Private Sub Workbook_Open() Worksheets(1).Range("A1").Value = Now() End Sub This shows current date and time but i only need it to change if workbook is modified. This code will be within a workbook that is sent from one country to another and needs to maintain its orginal timestamp.Can this be done? -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Timestamp Saved
I have a complie error appear to to a forms on open work book:
Private Sub Workbook_Open() UserForm4.Show End Sub Is there a way to get around this ???? "Dave Peterson" wrote: But if the user chooses to close without saving, then the change in the workbook_open event will be lost. If the user chooses to save, then your change is kept. If you don't want your change to mark the workbook as "dirty" (changed without being saved), you could use: Private Sub Workbook_Open() me.Worksheets(1).Range("A1").Value = Now me.saved = true End Sub Then the user won't be prompted to save because of this change. But any other change will cause the prompt to show up. jk wrote: I have the following code: Private Sub Workbook_Open() Worksheets(1).Range("A1").Value = Now() End Sub This shows current date and time but i only need it to change if workbook is modified. This code will be within a workbook that is sent from one country to another and needs to maintain its orginal timestamp.Can this be done? -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Timestamp Saved
Maybe give UserForm4 a name?
"jk" wrote: I have a complie error appear to to a forms on open work book: Private Sub Workbook_Open() UserForm4.Show End Sub Is there a way to get around this ???? "Dave Peterson" wrote: But if the user chooses to close without saving, then the change in the workbook_open event will be lost. If the user chooses to save, then your change is kept. If you don't want your change to mark the workbook as "dirty" (changed without being saved), you could use: Private Sub Workbook_Open() me.Worksheets(1).Range("A1").Value = Now me.saved = true End Sub Then the user won't be prompted to save because of this change. But any other change will cause the prompt to show up. jk wrote: I have the following code: Private Sub Workbook_Open() Worksheets(1).Range("A1").Value = Now() End Sub This shows current date and time but i only need it to change if workbook is modified. This code will be within a workbook that is sent from one country to another and needs to maintain its orginal timestamp.Can this be done? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
TimeStamp | Excel Discussion (Misc queries) | |||
How do I recover an Excel document saved not saved as | Excel Discussion (Misc queries) | |||
Timestamp | Excel Discussion (Misc queries) | |||
Timestamp | Excel Discussion (Misc queries) | |||
Timestamp | Excel Programming |