Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Map drive to open a file with code

Hello all, is it possible to "map" to a network drive, open a file and
then "disconnect" the drive again with code ? This is necessary as not
all users have access to the drive which is also password protected.

Any help would be appreciated...

Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Map drive to open a file with code

Why not just open the file via the UNC name.

You can do it in the file|open dialog or you can do it in code:

Dim wkbk as workbook
set wkbk = workbooks.open(Filename:="\\server\share\folder\fi le.xle")



Les Stout wrote:

Hello all, is it possible to "map" to a network drive, open a file and
then "disconnect" the drive again with code ? This is necessary as not
all users have access to the drive which is also password protected.

Any help would be appreciated...

Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Map drive to open a file with code

and that would probably be a .xls extension--not .xle!

Dave Peterson wrote:

Why not just open the file via the UNC name.

You can do it in the file|open dialog or you can do it in code:

Dim wkbk as workbook
set wkbk = workbooks.open(Filename:="\\server\share\folder\fi le.xle")

Les Stout wrote:

Hello all, is it possible to "map" to a network drive, open a file and
then "disconnect" the drive again with code ? This is necessary as not
all users have access to the drive which is also password protected.

Any help would be appreciated...

Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***


--

Dave Peterson


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Map drive to open a file with code

Hello Dave, this drive is not mapped in all cases... I tried your
suggestion but it does not find the file and it is there. If i map the
drive then it works fine but that is the initial problem...

Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Map drive to open a file with code

The drive doesn't need to be mapped to a letter if you refer to it by its UNC
path.

Try recording a macro when you open the file manually using that UNC path.

Maybe you mistyped something in the code and the recorded macro will help you
find it.

Les Stout wrote:

Hello Dave, this drive is not mapped in all cases... I tried your
suggestion but it does not find the file and it is there. If i map the
drive then it works fine but that is the initial problem...

Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***


--

Dave Peterson
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
From share drive particular excel file takes long time to open AshaPadmanabhan Excel Discussion (Misc queries) 0 April 13th 10 05:18 PM
format Excel to open in particular drive/file Jeanne Excel Discussion (Misc queries) 1 July 30th 09 04:46 PM
When I save a file on the hard-drive, it is fine, I can re-open, help Excel Discussion (Misc queries) 2 October 4th 06 10:13 PM
WINDOWS CANNOT OPEN THIS FILE IN A:\ DRIVE Hils Excel Discussion (Misc queries) 3 January 10th 06 02:24 PM
How do I open a file from a Network drive using Excel VBA? turnerje Excel Programming 1 August 2nd 05 10:43 PM


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

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

About Us

"It's about Microsoft Excel"