Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
No changes during Read-Only mode
The following code runs on a spreadsheet that lots of people access when the
workbook opens. My intention was to be able to see who had the workbook open for long periods of time. However, what happens when you try to open it and someone else already has it open, You get the Read Only choice and when you click that to open, it still puts your UserName. Anyway to do this where it doesn't update during Read Only mode? Thanks for the help! Sub Workbook_Open() ActiveSheet.Unprotect Password:="scbtloan" Range("B1").Value = Environ("UserName") Range("C1").Value = Format(Now, "dd mmm yyyy hh:mm:ss") ActiveSheet.Protect Password:="scbtloan" End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
No changes during Read-Only mode
Before setting the user and time, check the status:
if thisworkbook.readonly = false then .... end if "Jasmine" wrote: The following code runs on a spreadsheet that lots of people access when the workbook opens. My intention was to be able to see who had the workbook open for long periods of time. However, what happens when you try to open it and someone else already has it open, You get the Read Only choice and when you click that to open, it still puts your UserName. Anyway to do this where it doesn't update during Read Only mode? Thanks for the help! Sub Workbook_Open() ActiveSheet.Unprotect Password:="scbtloan" Range("B1").Value = Environ("UserName") Range("C1").Value = Format(Now, "dd mmm yyyy hh:mm:ss") ActiveSheet.Protect Password:="scbtloan" End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
No changes during Read-Only mode
Thank you so much! That worked great!
"bpeltzer" wrote: Before setting the user and time, check the status: if thisworkbook.readonly = false then ... end if "Jasmine" wrote: The following code runs on a spreadsheet that lots of people access when the workbook opens. My intention was to be able to see who had the workbook open for long periods of time. However, what happens when you try to open it and someone else already has it open, You get the Read Only choice and when you click that to open, it still puts your UserName. Anyway to do this where it doesn't update during Read Only mode? Thanks for the help! Sub Workbook_Open() ActiveSheet.Unprotect Password:="scbtloan" Range("B1").Value = Environ("UserName") Range("C1").Value = Format(Now, "dd mmm yyyy hh:mm:ss") ActiveSheet.Protect Password:="scbtloan" End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
[Read-Only] [Compatibility Mode] | Setting up and Configuration of Excel | |||
Read-Only Compatibility Mode | Excel Discussion (Misc queries) | |||
Read-Only Mode | Excel Discussion (Misc queries) | |||
Office Still Disabled - Read Only Mode | Setting up and Configuration of Excel | |||
Read only mode | Excel Programming |