ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open folder - Activeworkbook location (https://www.excelbanter.com/excel-programming/351531-open-folder-activeworkbook-location.html)

al007

Open folder - Activeworkbook location
 
Is it possible to open the folder of the active workbook location from
File-Open??
Any macro pls


Tom Ogilvy

Open folder - Activeworkbook location
 
Folders aren't opened. If you want the file=Open dialog to default to that
folder then make it the current directory with

ChDrive Activeworkbook.Path
ChDir ActiveWorkbook.Path
fname = application.GetOpenFileName()

--
Regards,
Tom Ogilvy


"al007" wrote in message
oups.com...
Is it possible to open the folder of the active workbook location from
File-Open??
Any macro pls




al007

Open folder - Activeworkbook location
 
Hi Tom,
The macro works fine - except if i use it when the active workbook is a
new one & has not yet been saved . What if error code do i have to add
to make the macro default to my D:\ drive in that case & everything
remaining the same otherwisse..
thxs

Tom Ogilvy wrote:
Folders aren't opened. If you want the file=Open dialog to default to that
folder then make it the current directory with

ChDrive Activeworkbook.Path
ChDir ActiveWorkbook.Path
fname = application.GetOpenFileName()

--
Regards,
Tom Ogilvy


"al007" wrote in message
oups.com...
Is it possible to open the folder of the active workbook location from
File-Open??
Any macro pls



al007

Open folder - Activeworkbook location
 
A file won't open also if activebook is from a drive only & is not in a
folder.
Can this be fixed?
Thxs



All times are GMT +1. The time now is 04:25 PM.

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