Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
KC KC is offline
external usenet poster
 
Posts: 107
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tempfiles on network share Heinrich Excel Discussion (Misc queries) 1 September 26th 07 03:19 PM
Browse to Network Share Yishion Excel Programming 0 June 18th 07 04:45 PM
Share macros on a network? [email protected] Excel Programming 5 June 10th 06 09:34 AM
Checking if you have a network connection clayton Excel Discussion (Misc queries) 0 May 31st 06 04:31 PM
share adodb connection in excel Marek Excel Programming 3 September 7th 04 08:56 AM


All times are GMT +1. The time now is 06:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"