Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default File directory

I am having trouble finding help on what i am looking to do, so i am hopeing
someone here can help me. I have a user form that has a text box and a
button in it. When the button is clicked i want a file directory to show up
so that the user can select a location, particular folder, and click ok.
This location will then be put into the textbox. The reason is that there
are a few other text boxes where the file name is entered and then another
button that will save as that name in the chosen location. Thanks in advance
for any help.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default File directory

i did get this working, but not quite what i want.

Private Sub CommandButton3_Click()
Dim TheFile As Variant
TheFile = Application.GetSaveAsFilename("C:\Temp\", , , "PLEASE CHOSE FILE
LOCATION", "SAVE HERE")
If TheFile = False Then
MsgBox "You cancelled"
Else
Me.TextBox3.Value = TheFile
End If
End Sub


TimB wrote:
I am having trouble finding help on what i am looking to do, so i am hopeing
someone here can help me. I have a user form that has a text box and a
button in it. When the button is clicked i want a file directory to show up
so that the user can select a location, particular folder, and click ok.
This location will then be put into the textbox. The reason is that there
are a few other text boxes where the file name is entered and then another
button that will save as that name in the chosen location. Thanks in advance
for any help.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default File directory

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)

TimB wrote:

I am having trouble finding help on what i am looking to do, so i am hopeing
someone here can help me. I have a user form that has a text box and a
button in it. When the button is clicked i want a file directory to show up
so that the user can select a location, particular folder, and click ok.
This location will then be put into the textbox. The reason is that there
are a few other text boxes where the file name is entered and then another
button that will save as that name in the chosen location. Thanks in advance
for any help.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default File directory

Tim,
Here's one way:
http://vbnet.mvps.org/code/browse/browsefolders.htm

I believe XL2003 and up have a built in dialog to do the same.

NickHK

"TimB" <u32108@uwe wrote in message news:6e74b2f7ac03c@uwe...
I am having trouble finding help on what i am looking to do, so i am

hopeing
someone here can help me. I have a user form that has a text box and a
button in it. When the button is clicked i want a file directory to show

up
so that the user can select a location, particular folder, and click ok.
This location will then be put into the textbox. The reason is that there
are a few other text boxes where the file name is entered and then another
button that will save as that name in the chosen location. Thanks in

advance
for any help.



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
file save error: the file or directory cannot be created dublg Excel Discussion (Misc queries) 1 September 25th 06 07:07 PM
Excel should let me sort the file directory when saving a file Beanee70 Excel Discussion (Misc queries) 0 March 14th 06 07:03 AM
Combine all text file in directory into one file. Rich[_19_] Excel Programming 8 January 21st 04 04:09 PM
File directory into a listbox Richard Edwards[_3_] Excel Programming 4 November 24th 03 12:32 PM
get path - save new file - same sub-directory as existing file tegger Excel Programming 2 October 21st 03 10:45 AM


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