Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Looking for code to browse Dir & Files

Hello:

I have a form where the user enters the name of a dir and
file name. I wish to enhace my model by providing the user
the option to look up the dir and file name using a browse
button. Is there code out there that could reuse?

Your help is appreciated,
-Neil
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Looking for code to browse Dir & Files

Hi Neil,

Try this...
---------------------
Private Sub cmdBrowse_Click()
filename = Application.GetSaveAsFilename("", "Excel Files
(*.xls), *.xls")
Do While filename = ActiveWorkbook.FullName
MsgBox "You can not select " & ActiveWorkbook.FullName
& " as the new file name!", vbCritical, "File Name Error"
filename = Application.GetSaveAsFilename("", "Excel
Files (*.xls), *.xls")
Loop
If filename = False Then filename = ""
End Sub
------------------------
Hope this helps...

Chong Moua
www.spreadsheetsolutions.com

-----Original Message-----
Hello:

I have a form where the user enters the name of a dir and
file name. I wish to enhace my model by providing the

user
the option to look up the dir and file name using a

browse
button. Is there code out there that could reuse?

Your help is appreciated,
-Neil
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Looking for code to browse Dir & Files

Neil,

If you want to return a folder, check out these links

http://j-walk.com/ss/excel/tips/tip29.htm

http://www.bmsltd.co.uk/MVP/MVPPage.asp#JimRech
look for the BrowseForFolder

If you want an easy way to return the full path of a file use

MyFileName = Application.GetOpenFileName
Opens a "Open File" type dialog box...
check out the help for getopenfilename, there's a lot of
functionality that it would take to long to explain...

Dan E

"Neil Bhandar" wrote in message ...
Hello:

I have a form where the user enters the name of a dir and
file name. I wish to enhace my model by providing the user
the option to look up the dir and file name using a browse
button. Is there code out there that could reuse?

Your help is appreciated,
-Neil



  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Looking for code to browse Dir & Files

Dan,

Thanks this is more on the lines of what I was looking
for... but in addition I need to be able to see the files
in the dir. not just directory names.

Is ther something out there that I could reuse?

Thanks,
-Neil

-----Original Message-----
Neil,

If you want to return a folder, check out these links

http://j-walk.com/ss/excel/tips/tip29.htm

http://www.bmsltd.co.uk/MVP/MVPPage.asp#JimRech
look for the BrowseForFolder

If you want an easy way to return the full path of a file

use

MyFileName = Application.GetOpenFileName
Opens a "Open File" type dialog box...
check out the help for getopenfilename, there's a lot of
functionality that it would take to long to explain...

Dan E

"Neil Bhandar"

wrote in message news:081901c397f5$9a34d040
...
Hello:

I have a form where the user enters the name of a dir

and
file name. I wish to enhace my model by providing the

user
the option to look up the dir and file name using a

browse
button. Is there code out there that could reuse?

Your help is appreciated,
-Neil



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Looking for code to browse Dir & Files

to get the file=Open dialog, you use

Application.GetOpenFileName()

see help for arguments.

--
Regards,
Tom Ogilvy

"Neil Bhandar" wrote in message
...
Hello:

I have a form where the user enters the name of a dir and
file name. I wish to enhace my model by providing the user
the option to look up the dir and file name using a browse
button. Is there code out there that could reuse?

Your help is appreciated,
-Neil





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
VBA code shared between .XLS files BitTwiddler Excel Discussion (Misc queries) 2 March 20th 09 04:04 PM
Does VBA code add to a files size? Jase Excel Discussion (Misc queries) 2 August 19th 08 03:53 PM
Trying to browse Add-ins???? [email protected] Excel Discussion (Misc queries) 1 March 5th 08 08:47 PM
Browse File for Mac John Vickers Excel Discussion (Misc queries) 1 February 17th 06 06:23 PM
How to repeat code for 11 files? Milind Excel Programming 0 August 6th 03 10:09 PM


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