Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Checking the connection to a network Share
I have a VBA macro that write to a network share however I have two problems.
1: The user is prompted to enter a username and password. I would like to place this in the macro. 2: I can't reference the computer with the shared folder by name and need to use the IP address. I would like to check the connection to the share before copying the file. In the past I use code like this: Dim Coll_Docs As New Collection Dim strSearch_path, strSearch_Filter, strSearch_Fullname As String Dim strDocName As String strSearch_path = strSharePath strSearch_Filter = "*.*" 'what files Set Coll_Docs = Nothing strDocName = Dir(strSearch_path & "\" & strSearch_Filter) Do Until strDocName = "" ' build the collection Coll_Docs.Add Item:=strDocName strDocName = Dir Loop intShareTest = Coll_Docs.Count it is a crude but if intsharetest is 0 then it has connected to the drive and sees the other files in the shared folder. This works if strSharePath ="//conputername/foldername" but doesnt work using "//ipaddress/foldername". I need a test that uses the IP address. Thanks, -- KC |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Tempfiles on network share | Excel Discussion (Misc queries) | |||
Browse to Network Share | Excel Programming | |||
Share macros on a network? | Excel Programming | |||
Checking if you have a network connection | Excel Discussion (Misc queries) | |||
share adodb connection in excel | Excel Programming |