Open Excel Workbook Using VBA Macros

Add to Favorites
Author:

Simple way to open an Excel workbook using VBA and macros.

Syntax

Workbooks.Open ("File Path")

Replace file path with the path to the file on your computer along with the full file name.

Here is what it looks like in the VBA Editor window:

Note: you do not always have to use the file extension of the file but it is a good practice to do so. In my example, using simply "D:\test" would also work.

Notes

There are MANY more options for opening a workbook but this post covers the basic usage of it, which will work for 98% of needed uses for this.

Here is a link to a full explanation on using this method if you need a more complex implementation of it: Workbook Open Method.

Make sure to download the accompanying workbooks to test this out in Excel.


Downloadable Files: Excel File

Question? Ask it in our Excel Forum


Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons 50+ Hours of Instruction 200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Similar Content on TeachExcel
Close Excel Workbook using VBA Macros
Tutorial: How to close an Excel workbook using VBA and macros, including how to save the file before...
Macro to get Data from Another Workbook in Excel
Tutorial: Macro to get data from a workbook, closed or open, over a network or locally on your comp...
Get User Submitted Data from a Prompt in Excel using VBA Macros
Tutorial: How to prompt a user for their input in Excel. There is a simple way to do this using VBA ...
Interactive Clickable Buttons and Interface Without Using VBA/Macros in Excel
Tutorial: How to make your Excel dashboards and worksheets more interactive and easier to view and ...
Loop through a Range of Cells in Excel VBA/Macros
Tutorial: How to use VBA/Macros to iterate through each cell in a range, either a row, a column, or ...
Kill Command in Excel (Delete Files Using VBA)
Tutorial: How to safely remove, delete, kill any Excel file, or other file, using VBA Macros in Exc...
Tutorial Details
Downloadable Files: Excel File
Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course