6 replies
by dklippert
This example displays the Open dialog box.
Application.FindFile
by dklippert
Here's some code. Use fileToOpen as the file name.
Sub ChooseFile()
fileToOpen = Application _
.GetOpenFilename("All Microsoft Excel Files (*.xls), *.xls")
If fileToOpen <> False Then
MsgBox "Open " & fileToOpen
End If
End Sub
by dklippert
Try:
Sub ChooseFile()
fileToOpen = Application _
.GetOpenFilename("Text Files (*.txt), *.txt")
If fileToOpen <> False Then
MsgBox "Open " & fileToOpen
End If
Workbooks.OpenText Filename:= fileToOpen, Origin:=xlWindows, _
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=True, Comma:=False, _
Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 1), Array( _
3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 4), Array(9, 4), Array(10 _
, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15, 1))
End Sub
by msoldan
by msoldan
This is the code that Excel spit out at me. I would like to change the part of the filename so that it will present an Open dialog box. I don't think that I can put that in and get my desired result. Thanks.
Workbooks.OpenText Filename:="D:\JAN2004_MOMHP0000_135608.TXT", Origin:=xlWindows, _
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=True, Comma:=False, _
Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 1), Array( _
3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 4), Array(9, 4), Array(10 _
, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15, 1))
by msoldan
This discussion is closed to new replies.
Trending Software posts
Sort by Trending