-
Solved: VB6 an Excel Filedialog
Can't seem to get the right VB6 syntax to open an Excel file dialog. Here's what works in XL VBA...
[vba]
With Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect = False
.Show
'get selected file name
For Each VrtSelectedItem In .SelectedItems
FLname = VrtSelectedItem
Next
End With
[/vba]
This doesn't work in VB6 (automation error)...
[vba]
Dim ObjExcel As Object
Set ObjExcel = CreateObject("EXCEL.APPLICATION")
With ObjExcel.FileDialog(fileDialogType:=msoFileDialogfilepicker)
.AllowMultiSelect = False
.Show
End With
[/vba]
Any help will much appreciated. Dave
-
You will need to add a reference to the Microsoft Office 12.0 libary for the msoFileDialogfilepicker
EDIT: Changed 11.0 to 12.0 Tommy
-
Thanks Tommy. That works much better. It is 11.0 for my VB6. Have a nice day. Dave
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules