PC Review


Reply
Thread Tools Rate Thread

Circumvent drive mappings, reference network location

 
 
=?Utf-8?B?S2F0aHJ5bjIwOA==?=
Guest
Posts: n/a
 
      14th Nov 2006
Can office programs (Excel specifically) to recognize a
network location that DOES NOT include a drive letter?

For example, can Excel link to the datasource:
\\server_name\folder_name\data_source.mdb

Rather than:
P:\folder_name\data_source.mdb




 
Reply With Quote
 
 
 
 
Chip Pearson
Guest
Posts: n/a
 
      14th Nov 2006
In general, yes. The following worked for me

Workbooks.Open "\\DellLaptop\MainDrive\book1.xls"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com
(email address is on the web site)


"Kathryn208" <(E-Mail Removed)> wrote in message
news:0CCB686E-2E7D-43F4-9070-(E-Mail Removed)...
> Can office programs (Excel specifically) to recognize a
> network location that DOES NOT include a drive letter?
>
> For example, can Excel link to the datasource:
> \\server_name\folder_name\data_source.mdb
>
> Rather than:
> P:\folder_name\data_source.mdb
>
>
>
>



 
Reply With Quote
 
=?Utf-8?B?SmltIFRob21saW5zb24=?=
Guest
Posts: n/a
 
      14th Nov 2006
I have never had an issue with this. I also have this code which will tell
you the server mapping of a local drive letter (for whatever it's worth)...

Option Explicit

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

Sub Test()
MsgBox UNCfromLocalDriveName("P")
End Sub

Function UNCfromLocalDriveName(strLocalDrive) As String
'Find UNC from Local path
'i.e. Local drive "F:" = "\\RdaServer3\sys1"
' example of usage: UNCfromLocalDriveName("P") <-Actual Drive Letter
' or UNCfromLocalDriveName(A2) <-Cell reference
'
Dim sLocal As String
Dim sRemote As String * 255
Dim lLen As Long

Application.Volatile

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

lLen = 255
sLocal = strLocalDrive & ":"

WNetGetConnection sLocal, sRemote, lLen

UNCfromLocalDriveName = Trim(sRemote)

End Function
--
HTH...

Jim Thomlinson


"Kathryn208" wrote:

> Can office programs (Excel specifically) to recognize a
> network location that DOES NOT include a drive letter?
>
> For example, can Excel link to the datasource:
> \\server_name\folder_name\data_source.mdb
>
> Rather than:
> P:\folder_name\data_source.mdb
>
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Always a red X on network drive mappings bmense Microsoft Windows 2000 Networking 1 19th Jan 2006 04:00 AM
Out of drive letters for network mappings =?Utf-8?B?amVzc2Vt?= Microsoft Windows 2000 2 28th Feb 2005 06:03 PM
always a red X on network drive mappings Brian Mense Microsoft Windows 2000 Networking 0 23rd Sep 2004 12:59 PM
Lost network drive mappings!! Stephen Microsoft Windows 2000 Networking 1 17th Nov 2003 05:46 PM
Network Drive Mappings Shaun Windows XP Networking 0 6th Oct 2003 04:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:57 PM.