What is it:
This VBA Code will help you browse and Open Excel File from Folder or a directory.
When you create a program and if you want to provide the user an option to select a particular Excel file and open then this code can be used for the same.
How to Open Excel File from Folder using VBA Code:
Step 1: Open the workbook and press Alt + F11 to insert the code.
Step 2: Copy and Paste the below code in the VBA editor window and Save the workbook.
Dim xlName As Variant
xlName = Application.GetOpenFilename(FileFilter:=”Excel Workbooks,*.xl*”, Title:=”Choose a Workbook to Open”, MultiSelect:=False) ‘GetOpenFilename Method activates dialog box
If xlName <> False Then