LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Get name of user who has a file open or checked out from a Sharepoint

I have a file that lives on a SP, that multiple users access through a
URL (in other words they don't use "check out" they just click the
URL).

I want a routine to run when they open the file that checks if the
file is in use (in which case it will have opened automatically a read-
only, it would seem). If it is in use, I want to return the name of
the user that has it open.

So far I have:

--------------------------
myPath = ActiveWorkbook.Path
myName = ActiveWorkbook.Name

myUser = ActiveWorkbook.WriteReservedBy

myFile = myPath & "\" & myName


If Workbooks.CanCheckOut(myFile) = False Then 'assume is out with some
other user
MsgBox "File is in use by " & myUser, vbExclamation + vbOKOnly,
ActiveWorkbook.Name
End If
-------------------------------
My problem is the "WriteReservedBy" property doesn't seem to give me
what I want. Even though the file is loaded by me as read-only, it
still gives my name instead of the real user who has that file open.

This is driving me crazy - i've searched everywhere. Any ideas?

Many thanks in advance.



 
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
Open Excel file from SharePoint; opens as ReadOnly ryguy7272 Excel Programming 0 May 25th 10 03:29 PM
Open Sharepoint Hosted Excel File, in Excel, Using VBA PatK Excel Programming 3 June 2nd 09 02:30 PM
VBA Code to open an Excel file on a sharepoint site Vit[_2_] Excel Programming 4 September 4th 08 08:01 AM
User replaces existing file with blank during file open sjs Excel Discussion (Misc queries) 3 August 18th 08 06:16 PM


All times are GMT +1. The time now is 04:41 PM.

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

About Us

"It's about Microsoft Excel"