Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
open all files in directory davethewelder Excel Discussion (Misc queries) 2 August 26th 08 02:01 PM
open in old directory save in new directory tim64[_2_] Excel Programming 0 June 15th 05 07:48 PM
Open a new Directory CLR[_2_] Excel Programming 6 June 22nd 04 09:16 PM
Open files in directory V. Roe Excel Programming 2 November 4th 03 07:45 PM
Open all files in a directory Tom Waters[_2_] Excel Programming 1 September 3rd 03 12:59 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"