-
I would like to try xld's way but would like to know where i need to put that piece of coding he has provided above [VBA]Declare Function WNetGetConnection32 Lib "MPR.DLL" Alias "WNetGetConnectionA" ( _
ByVal lpszLocalName As String, _
ByVal lpszRemoteName As String, _
lSize As Long) As Long
Const NO_ERROR As Long = 0
Const lBUFFER_SIZE As Long = 255
Function GetUNCPath(Driveletter As String) As String
Dim mpRemoteName As String
Dim lSize As Long
Driveletter = Driveletter & ":"
mpRemoteName = mpRemoteName & Space(lBUFFER_SIZE)
If WNetGetConnection32(Driveletter, _
mpRemoteName, _
lBUFFER_SIZE) = NO_ERROR Then
GetUNCPath = mpRemoteName
End If
End Function [/VBA]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules