FileDialog

J

Johnny Bright

Hi there!

I'm trying to invoke the file import window with the following code:

Dim fd As FileDialog

Set fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
.AllowMultiSelect = False
'.InitialFileName = txtFileName
'.Filters.Delete 1
.Filters.Add "Excel Files", "*.csv", 1
If .Show = -1 Then
txtFileName = .SelectedItems(1)
End If
End With
Set fd = Nothing

This has worked before in another application in another office, but when I
try it here at home I get a user defined type error. Perhaps I don't have
the right reference to this object. Which reference is it a part of or am I
doing something else wrong?

Thanks

J
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top