Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 89
Default Finding a Workbook's Location

Hello,
I would like to find a workbooks on the C directory, but searching all files
takes too long. Is there a quicker way? Is there a way to ask the user to
enter the folder where the file is located (like the browse dialog box)?

Thanks.

Bill


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Finding a Workbook's Location

You could use a macro that opens the File|Open dialog to get the name of an
existing file.

Dim myFileName as Variant
myfilename=application.getopenfilename("excel files, *.xls")
if myfilename=false then
'user hit cancel
'do something
else
msgbox myfilename 'do whatever you need with that variable
end if

===

If you're really just looking for a folder name from the user...

Jim Rech has a BrowseForFolder routine at:
http://www.oaltd.co.uk/MVP/Default.htm
(look for BrowseForFolder)

John Walkenbach has one at:
http://j-walk.com/ss/excel/tips/tip29.htm

If you and all your users are running xl2002+, take a look at VBA's help for:
application.filedialog(msoFileDialogFolderPicker)



Bill wrote:

Hello,
I would like to find a workbooks on the C directory, but searching all files
takes too long. Is there a quicker way? Is there a way to ask the user to
enter the folder where the file is located (like the browse dialog box)?

Thanks.

Bill


--

Dave Peterson
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
Finding a cell location Lucask New Users to Excel 3 February 26th 09 01:14 PM
Finding the Location within an Array Sh0t2bts Excel Worksheet Functions 2 December 5th 07 01:06 PM
Finding the location of what was summed [email protected] Excel Worksheet Functions 3 May 21st 07 08:15 PM
Finding the location of MAX value in column milly Excel Discussion (Misc queries) 2 May 11th 07 12:15 PM
vba...finding location of number chick-racer[_42_] Excel Programming 1 November 26th 03 01:53 PM


All times are GMT +1. The time now is 07:57 AM.

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

About Us

"It's about Microsoft Excel"