Actual open a file using a Filedialog box

  • Thread starter Thread starter Dave K.
  • Start date Start date
D

Dave K.

I have the following code in the on click event procedure for a toggle button.

Dim dlgOpen As FileDialog

Set dlgOpen = Application.FileDialog(DialogType:=msoFileDialogOpen)

With dlgOpen
.AllowMultiSelect = True
.Show
End With

End Sub

I want to actually open a file when I clck the open button in the dialog box
not return the file file path.
 
Get the path of the file as you are doing now and then send it through the
ShellExecute API (as can be found at mvps.org/access in their API section)

hth
--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
Or, assuming that the full path to the selected file is stored in a variable
strFile, use

Application.FollowHyperlink strFile
 
Back
Top