Error Code 9 while trying to auto populate excel sheet

excelnovvce

New Member
Joined
Mar 19, 2018
Messages
1
So this is my code:

Dim src As Workbook

Set src = Workbooks.Open("UMF_IR_ADM_<wbr style="font-family: arial, sans-serif; font-size: 12.8px;">SPARTACUS_1910 (Data as of 3-5-2018)")

Worksheets("Executive").Range(<wbr>"D7").Value = WorksheetFunction.Sum(src.<wbr>Worksheets("Data").Range("A3:<wbr>A10000"))


Worksheets("Executive").Range(<wbr>"D8").Value = WorksheetFunction.Sum(src.<wbr>Worksheets("Data").Range("AV3:<wbr>AV1854"))



which opens the UMF_IR_SPARTACUS and is supposed to take the sum of the data in the spartacus file and put it in D7 of the original workbook that I'm in. It was working before I put the src. stuff. Now it's giving me a error 9: subscript out of range. Any help would be appreciated. Thanks.

Also this isn't the full code.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hi & welcome to the board.
Try adding the file extension along with the filepath
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,157
Members
453,021
Latest member
Justyna P

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