File Dialog Picker

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am attempting to use the dialog picker to select a file from a dialog box
and then use that same file in the DoCmd.transferspreadsheet method. It
allows me to select the file, but then it gives me an error message stating
can not find the file ...mso/FileDialogFilePicker.

My code is:

Private Sub Command1_Click()
On Error GoTo test_import_Err

Dim fd As FileDialog

Set fd = Application.FileDialog(msoFileDialogFilePicker)

Dim vrtSelectedItem As Variant

With fd

If .Show = True Then

For Each vrtSelectedItem In .SelectedItems

Next vrtSelectedItem

Else

End If

End With

DoCmd.TransferSpreadsheet acImport, 8, "H_and_W Temp", fd, True

test_import_Exit:
Exit Sub

test_import_Err:
MsgBox Error$
Resume test_import_Exit

End Sub
 
Back
Top