![]() |
Open Directory
I need a macro that will open up a directory, not a file. The directory's
full address is on a sheet in the same file where the button is. I am using mainly Excel 5 files although occasionally I use the Excel 2002 version if it absolutely necessary. Any help would be greatly appreciated, Roger |
Open Directory
Open a directory is pretty meaningless.
Do you want to open every file in a directory? Dim fName as String fname = Dir("C:\Myfolder\*.xls") do while fname < "" workbooks.Open("C:\MyFolder\" & fname) fName = Dir() Loop -- Regards, Tom Ogilvy "Roger B." wrote in message ... I need a macro that will open up a directory, not a file. The directory's full address is on a sheet in the same file where the button is. I am using mainly Excel 5 files although occasionally I use the Excel 2002 version if it absolutely necessary. Any help would be greatly appreciated, Roger |
Open Directory
Roger,
What does "open a directory" mean? Do you want to allow a user to select a directory from a dialog box? If so, see http://www.cpearson.com/excel/BrowseFolder.htm . If not, you need to be much more specific in your post. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Roger B." wrote in message ... I need a macro that will open up a directory, not a file. The directory's full address is on a sheet in the same file where the button is. I am using mainly Excel 5 files although occasionally I use the Excel 2002 version if it absolutely necessary. Any help would be greatly appreciated, Roger |
Open Directory
Thanks Tom and Chip for your suggestions. Tom I have kept yours for other
uses. The reason that I want the macro to only open the directory and no more is either because I have a lot of backups of a file that I am creating and want to easily go back to earlier files or because there are several files that I know are in a directory and I can easily choose then which one I want. Many thanks, Roger "Chip Pearson" wrote in message ... Roger, What does "open a directory" mean? Do you want to allow a user to select a directory from a dialog box? If so, see http://www.cpearson.com/excel/BrowseFolder.htm . If not, you need to be much more specific in your post. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Roger B." wrote in message ... I need a macro that will open up a directory, not a file. The directory's full address is on a sheet in the same file where the button is. I am using mainly Excel 5 files although occasionally I use the Excel 2002 version if it absolutely necessary. Any help would be greatly appreciated, Roger |
All times are GMT +1. The time now is 01:25 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com