Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default If A Directory Exists

Instead of using the drive letter why not jsut use the complete drive
mapping, something like...

Workbooks.Open ("\\myServer\myDirectory\Statements\netcap.xls" )

You can ge the \\myserver\mydirectory from lookin in Windows explorer at the
drive mapping next to the drive letter.
--
HTH...

Jim Thomlinson


"achidsey" wrote:

Excel Experts,

My code needs to open a file in a network directory named "Statements".

For me, Statements is under my "T:" drive, but for other users, it's
somewhere else.

I generally run this code, so I don't want to ask for a drive letter every
time. What I want my code to do is ask, "is the directory "T:\Statements"
available?"

If the code is running on my machine, the above question will generate Yes
and the code will continue to the Then branch.

If someone else whose Statements folder is under another drive letter, the
question will generate No, and my code will go to the Else branch.

My code will be something like:

If T:\Statements Exists Then

Workbooks.Open ("T:\Statements\netcap.xls")

Else

Letter = InputBox("Enter the Drive Letter for the Statements folder")

Workbooks.Open(Letter & ":\Statements\netcap.xls")

End If

My question is, How do I ask "If T:\Statements exists"?

Thanks,
Alan


--
achidsey

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
File exists under directory PeterW[_10_] Excel Programming 2 December 16th 05 01:14 AM
Creating a macro that lists directory names within a directory.... Andy Excel Programming 4 November 28th 04 06:13 AM
Check if a directory exists and if it doesn t... Grek[_5_] Excel Programming 5 May 8th 04 09:12 PM
How to check if the directory exists? ira Excel Programming 2 January 19th 04 01:22 PM
Verify a directory exists MacroMan[_4_] Excel Programming 3 August 8th 03 04:38 PM


All times are GMT +1. The time now is 11:19 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"