vba to open workbook

jondavis1987

Active Member
Joined
Dec 31, 2015
Messages
443
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

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
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
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
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,213,543
Messages
6,114,243
Members
448,555
Latest member
RobertJones1986

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
Back
Top