LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using a "File-Open"-Window in a Excel Macro?

Here you go Peter!

Attached is a workbook with the code to accomplish what you want. Jus
run the "BrowseFolder" macro and you will be presented with a Window
Explorer window which will allow you to select a directory of you
choice. Once selected, click OK and the path to the directory you jus
selected will be placed in the text box on the included form. The inf
from this text box will then be used with a loop to populate a listbo
on the same form with each of the filenames found within that specifi
directory. After selecting one of the files from the list box an
clicking the submit button, you will write the directory path, th
selected filename, and the full file path to cells in columns A, B, an
C of the worksheet. Just step through the code and make whateve
changes you need.

The original code which I obtained from a former co-worker was found o
the internet and was originally developed as a stand-alone VB
application. The original version of this project could only be use
for obtaining the directory path but I modified the code so that i
would also list each individual files within a specific directory. Th
code was also modified by me so that it would work with Excel VBA.
have been using this code with several Excel macros I have written an
it works great!! The macro will crash if you run the applicatio
straight from the provided link below so make sure to right click th
link and save the workbook before running it. Good luck, I hope thi
helps! :)



Rolli

Attachment filename: browse for folder.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=52136
--
Message posted from http://www.ExcelForum.com

 
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
I am trying to open a ".gz" file with a macro in Excel 2003. Joe D Excel Discussion (Misc queries) 25 May 10th 09 12:53 PM
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. Phillip Pi Excel Discussion (Misc queries) 0 April 23rd 09 08:53 PM
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. Phillip Pi Setting up and Configuration of Excel 0 April 23rd 09 08:53 PM
modify how files are displyed in the "file open" window Brett Excel Discussion (Misc queries) 3 February 23rd 08 01:59 AM
How to change the font of Display window of "Open File" Windows Font Excel Discussion (Misc queries) 0 January 6th 06 03:10 AM


All times are GMT +1. The time now is 03:09 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"