vba to open workbook

jondavis1987

Active Member
Joined
Dec 31, 2015
Messages
425
Office Version
  1. 2019
Platform
  1. Windows
What am I doing wrong?

Code:
Sub Open_Workbook()
'Open Workbook
Workbooks.Open ("Users\jdavis\Dropbox\Quality Control\Asphalt\Misc\Yearly HMA Charts.xls")
End Sub
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

jondavis1987

Active Member
Joined
Dec 31, 2015
Messages
425
Office Version
  1. 2019
Platform
  1. Windows
I've tried this but it seems to fail at the workbooks.open line and says it couldn't find it but that's the exact filepath

Code:
Sub Open_Workbook()
'Open Workbook
Workbooks.Open "C:\Users\jdavis\Dropbox\Quality Control\Asphalt\Misc\Yearly HMA Charts.xls"
End Sub
 
Upvote 0

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
18,069
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
I've tried this but it seems to fail at the workbooks.open line and says it couldn't find it but that's the exact filepath

Code:
Sub Open_Workbook()
'Open Workbook
Workbooks.Open "C:\Users\jdavis\Dropbox\Quality Control\Asphalt\Misc\Yearly HMA Charts.xls"
End Sub
Perhaps you haven't gotten the exact file path. Here's a quick test to ensure you have it right.
1. Open the workbook manually
2. With the workbook open, press alt+F11 keys to open the VBE
3. Press ctrl + g keys to open the immediate window
4. In the Immediate window type (w/0 quote marks) "?Activeworkbook.FullName" and press the Enter key
 
Upvote 0

jondavis1987

Active Member
Joined
Dec 31, 2015
Messages
425
Office Version
  1. 2019
Platform
  1. Windows
I appreciate the help. I had the filepath correct, but I didn't put ".xlsx" instead I just had"xls"
 
Upvote 0

Forum statistics

Threads
1,191,532
Messages
5,987,123
Members
440,080
Latest member
drhorn4908

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top