![]() |
getting a message box with the unc file path
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. |
getting a message box with the unc file path
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 '/========================================== " wrote: 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. |
All times are GMT +1. The time now is 12:34 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com