Open Excel Workbook Using VBA Macros

Add to Favorites

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


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.


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.

Question? Ask it in our Excel Forum

Downloadable Files: Excel File 1, Excel File 2

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 ...
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 ...
Join a Date and Time into a Single Cell using VBA Macros in Excel
Tutorial: In order to combine a cell that has a date with a cell that has a time, using a Macro and ...
Login to a Website using a Macro
: Connect and login to a website using a macro in Excel. This allows you to open a website a...