Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to get username during workbooks.open macro
I have a macro that opens an xl2003 workbook on a network. If the workbook
being opened is already opened by another user, the macro will open a read only copy without displaying the usual "Locked fo editing" message. I figured out how to stop the file from opening, but I really need to be able to display the name of the user that has the file locked. I've been trying to figure this out for about 3 hours now. Any help would be greatly appreciated! Here is an example of the code I'm using to stop the file from opening, I'm sure there's a more efficient way to do it, but I'm kinda learning as I go. Sub testreadonly() Workbooks.Open ("M:\read only test.xls") If ActiveWorkbook.ReadOnly Then MsgBox ("This workbook is currently opened by another user. Please try again later.") ActiveWorkbook.Close End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run Macro In All Open Workbooks | Excel Discussion (Misc queries) | |||
Repeat macro for all open workbooks | Excel Programming | |||
XMLHTTP.OPEN + PASSWORD + USERNAME | Excel Programming | |||
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed | Excel Programming | |||
Open two new workbooks with macro | Excel Programming |