getting a message box with the unc file path

K

koroth112

I need help getting a message box with a unc file path to pop up(ie. \
\server1\folder1\file1)
my current code is
Sub whatisfilepath()

MsgBox ActiveWorkbook.Path

End Sub

i need to know if it is possable to have a unc file path
any help is good help.
 
G

Gary Brown

Untried as I don't have a network at home but....

Private Declare Function WNetGetConnection Lib "mpr.dll" _
Alias "WNetGetConnectionA" _
(ByVal lpszLocalName As String, _
ByVal lpszRemoteName As String, _
cbRemoteName As Long) As Long

'basics created by Frank Isaacs (www.DolphinTechnology.com/Frank)
'10/24/2000
'/==========================================
Sub UNCfromLocal()
'Find UNC from Local path
'i.e. Local drive "F:" = "\\RdaServer3\sys1"
Dim sLocal As String
Dim sRemote As String * 255
Dim lLen As Long
Dim strAnswer As String

sRemote = String$(255, Chr$(32))

lLen = 255

sLocal = UCase(InputBox("Enter Local Drive Letter", "Do NOT use ':' ..."))

WNetGetConnection sLocal, sRemote, lLen

MsgBox sLocal & ": " & sRemote
End Sub
'/==========================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top