Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
File exists under directory | Excel Programming | |||
Creating a macro that lists directory names within a directory.... | Excel Programming | |||
Check if a directory exists and if it doesn t... | Excel Programming | |||
How to check if the directory exists? | Excel Programming | |||
Verify a directory exists | Excel Programming |