Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Identify if another user has spreadsheet open - in VBA
I would like to run a vba routine if a particular workbook
is not currently in use by someone else. I cannot find any function ore code that will identify if the book is in use or not. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Identify if another user has spreadsheet open - in VBA
Hi
You have to open it by code. From there, if it's Readonly then someone else has its exclusive rights. Or, if you are lucky, the WriteReservedBy property will return the username of this exclusive user. I believe that a faster and safer solution is to have a small macro in that particular book that logs to an available textfile or whatever when and who is opening/closing it. Then you don't have to touch the file to find this information. -- HTH. Best wishes Harald Followup to newsgroup only please. "gp" wrote in message ... I would like to run a vba routine if a particular workbook is not currently in use by someone else. I cannot find any function ore code that will identify if the book is in use or not. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Identify if another user has spreadsheet open - in VBA
Harald wrote:
You have to open it by code.<<snip Not necessarily, you could place code on ThisWorkbook code page... Private Sub Workbook_Open() If ActiveWorkbook.ReadOnly = False Then 'Means workbook is not read only '<call your code/function/sub here End if End Sub regards ricky |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Identify if another user has spreadsheet open - in VBA
"Ricky M. Medley" wrote in message
... You have to open it by code.<<snip Not necessarily, you could place code on ThisWorkbook code page... Well yes, sorry. You could of course open it manually and then have some code running. You could even open it manually, read the prompt "This file is in use by Harry Callahan. Do you want to open it Readonly ? Do you feel lucky today ?" and then type "Harry has it" into a Word macro. Point is, you have to actually open the file to get any information. And the lady said VBA. But you're right. Best wishes Harald Followup to newsgroup only please. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I compare two seperate spreadsheet files to identify diff | Excel Discussion (Misc queries) | |||
Please help: identify where an automatic link to other spreadsheet is? | Excel Worksheet Functions | |||
identify duplicate data in excel spreadsheet | Excel Discussion (Misc queries) | |||
How do I identify dulicate rows in a spreadsheet? | Excel Discussion (Misc queries) | |||
How to open another Excel spreadsheet to copy data into current spreadsheet ? | Excel Programming |