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

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Hi & welcome to the board.
Try adding the file extension along with the filepath
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,184
Members
452,615
Latest member
bogeys2birdies

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