Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Directories ans Drive Controls in Excel VBA

Status
Not open for further replies.

chateaucl

IS-IT--Management
Feb 5, 2001
9
CL
I am trying to use directories and drive control to make a file selection form in a Excel application, but i can't find those control in excel vba toolbar. I looked in 'Aditional Controls', but i don't know how to set them.

I am using Excel XP. I also have installed Visual Basic 6.0.


Thanks.
 
Here are three ways to display a browse window so the user can pick a file:
Code:
Sub PickFile()
Dim flPath As String
    'Can specify starting directory but must click "Save" button in somewhat confusing fashion. Open file separately.
'flPath = Application.GetSaveAsFilename(InitialFileName:="C:\VBA\")

    'May browse to find file, then click "Open" button. Open file separately.
'flPath = Application.GetOpenFilename

'If flPath <> "False" Then Workbooks.Open flPath

    'Display the File Open dialog. File will be opened when you click the Open button
Application.Dialogs(xlDialogOpen).Show
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top