Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Getting open file's directory, captureing user login ID, write access
I have a few questions.
1: How can I get the directory for the currently opened excel file? 2: Is there a way to capture the login ID for the user currently using the excel macro? 3: Is there a way to only let data be written to a spreadsheet via a user form? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Getting open file's directory, captureing user login ID, write access
1. ActiveWorkbook.Path
2. Here is a simple function that returns the network user id Public Declare Function GetUserName Lib "advapi32.dll" _ Alias "GetUserNameA" _ (ByVal lpBuffer As String, _ nSize As Long) As Long Public Function UserName() As String Dim sName As String * 256 Dim cChars As Long cChars = 256 If GetUserName(sName, cChars) Then UserName = Left$(sName, cChars - 1) End If End Function 3. Probably need to protect it, and remove the protection when you want to write to it, then re-apply it. -- HTH RP (remove nothere from the email address if mailing direct) "Claud Balls" wrote in message ... I have a few questions. 1: How can I get the directory for the currently opened excel file? 2: Is there a way to capture the login ID for the user currently using the excel macro? 3: Is there a way to only let data be written to a spreadsheet via a user form? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Getting open file's directory, captureing user login ID, write access
I just tried out your first two suggestions, EXCELLENT HELP!! thank you
and Merry Christmas. I have yet to deal with #3. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Open Specific Form by User Login | Excel Discussion (Misc queries) | |||
Unshared workbook allowing write access to more than 1 user | Excel Discussion (Misc queries) | |||
Login and logoff to active directory by VBA | Excel Discussion (Misc queries) | |||
Is this right (open for write access) | Excel Programming | |||
How to get file's current directory path to a string in VBA? | Excel Programming |