Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA code shared between .XLS files | Excel Discussion (Misc queries) | |||
Does VBA code add to a files size? | Excel Discussion (Misc queries) | |||
Trying to browse Add-ins???? | Excel Discussion (Misc queries) | |||
Browse File for Mac | Excel Discussion (Misc queries) | |||
How to repeat code for 11 files? | Excel Programming |