ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Finding Current Path (https://www.excelbanter.com/excel-programming/327043-finding-current-path.html)

Mike C

Finding Current Path
 
Im creating a program that is pulling information from the cd it is located
on. I am running into trouble with the fact that people have differnt names
for their cd drives. I need my program to be able to tell which drive it is
in. I've tryed the CurDir and it only will give the path that i had originaly
on my computer instead of the present one. I know this is an easy fix but im
stuck. Also is there any way to run a macro upon opening of the program
instead of having to click on a button?

Jake Marx[_3_]

Finding Current Path
 
Hi Mike,

Mike C wrote:
Im creating a program that is pulling information from the cd it is
located on. I am running into trouble with the fact that people have
differnt names for their cd drives. I need my program to be able to
tell which drive it is in. I've tryed the CurDir and it only will
give the path that i had originaly on my computer instead of the
present one. I know this is an easy fix but im stuck. Also is there
any way to run a macro upon opening of the program instead of having
to click on a button?


ThisWorkbook.Path should give you what you're looking for. It will return
the path of the workbook in which your code resides.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]



All times are GMT +1. The time now is 03:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com