Path

S

Stéphane Simard

I

Could you tell me how can i write this line to tell to Excel to open the
document "Doc" in volume where Excel actualy run?
In this exemple "MYHARDDRIVE"


Workbooks.Open Filename:="MYHARDDRIVE:Doc"

Thank you!
 
B

Bob Phillips

Stéphane,

Workbooks.Open Filename:= Application.Path & "\" & "Doc"

should do it

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
S

Stéphane Simard

This will be save "Doc" in the folder of the application, no?

Me i want save it on the root of the drive.

in fact, i want know the name of actual drive.

Thank you
 
B

Bob Phillips

Sorry old bean, didn't deduce that from your post. Try this instead

myHardDrive = Left(Application.Path,2)
Workbooks.Open Filename:= myHardDrive & "\" & "Doc

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top