Run Time Error 9: Subscript Out of Range -- Pivot Table

XLMaitre

New Member
Joined
Aug 16, 2017
Messages
2
Hello Everyone.,

I'm new to this forum. :)

I'm having some trouble running a macro from my personal workbook. I created a macro in another workbook ("Report1") but saved it to my personal workbook.

When I run the run macro in a different workbook ("Report2"), I get a run time error 9 message for subscript out of range. This is what debugging is showing:

Workbooks("08152017 - Report1.xlsx").Connections. _
Add2 _
"WorksheetConnection_08152017 - Report1.xlsx!Table13" _
, "", _
"WORKSHEET;C:\Users\johnsmith\Documents\reports 2017\2017\August\08152017 - Report1.xlsx" _
, "08152017 - Report1.xlsx!Table13", 7, True, False

Any ideas why I keep getting the subscript out of range?

I also created a dynamic table before creating a pivot table because my rows change constantly but the columns remain the same. I do this in order to avoid another more debug issues :)

Thanks!
 

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'm wondering if this is due to the ".connections" or the other workbook.

Sorry. I'm not fully proficient in VBA.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

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