Run Time error 9 - Subscript out of range

tesla764
tesla764 used Ask the Experts™
on
Please see the attached Word file for more details including screen shots.

When I execute the statement...
Set vWB = Workbooks("C:\Users\Ritsick\Documents\Red_Compass\DRA\DRA Summary.xlsx")

I get the following error...
Run-time error '9':
Subscript out of range
EE-Run-Time-error-9---Subscript-.docx
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Retired
Top Expert 2012
Commented:
The Workbooks collection comprises all the workbooks that are already open in the application.

If you want to open one, use:

Set vWB = Workbooks.Open("C:\Users\Ritsick\Documents\Red_Compass\DRA\DRA Summary.xlsx")

Open in new window

GrahamSkanRetired
Top Expert 2012

Commented:
To set the variable to an already open workbook, just use the name

Set vWB = Workbooks.("DRA Summary.xlsx")

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial