Hello Everyone,
I would appreciate if someone guide me to code a direction to VBA excel to open a file in specific file within my computer.
Please make it simple as I am a beginner in the VBA.
Thanks in advance!
Hello Everyone,
I would appreciate if someone guide me to code a direction to VBA excel to open a file in specific file within my computer.
Please make it simple as I am a beginner in the VBA.
Thanks in advance!
here is a sample:
Private Sub test2() Dim strFile As String With Application.FileDialog(msoFileDialogFilePicker) 'Makes sure the user can select only one file .AllowMultiSelect = False 'Filter to just the following types of files to narrow down selection options .Filters.Add "All Files", "*.*", 1 'Show the dialog box .Show 'Store in fullpath variable strFile = .SelectedItems.Item(1) 'if a file is selected then Open it If Len(strFile) <> 0 Then CreateObject("Shell.Application").ShellExecute strFile, "", "", "Open" End If End With End Sub