Run Time Error 5 (Excel 2013 Compatibility Issues?)

TeachMeEverything

New Member
Joined
Jan 26, 2015
Messages
18
Hello,

I created a macro for my work that seems to be working just fine, until a different version of excel gets to it. The Macro was created in Excel 2013 but when its ran in 2010 it hits a runtime error 5 message. Is it something with the coding or is it a compatibility issue?

The macro is pretty brute as I recorded most of it with the recorder and fine tuned using this website to teach me some things. Hoping to learn a lot more as I go but this one stumped me, is there a known compatibility issue for these two versions?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Thanks again,

Sub InvClick()
'
' InvClick Macro
'

'
Range("E1").Select
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"OnHandData!R1C1:R20000C16", Version:=xlPivotTableVersion15).CreatePivotTable _
TableDestination:="Inventory!R1C1:R1C9", TableName:="PivotTable4", _
DefaultVersion:=xlPivotTableVersion15
 
Upvote 0
Thank you but im still getting the run time 5 error...


Sub InvClick()
'
' InvClick Macro
'

'
Range("E1").Select
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"OnHandData!R1C1:R20000C16", Version:=xlPivotTableVersionCurrent).CreatePivotTable _
TableDestination:="Inventory!R1C1:R1C9", TableName:="PivotTable4", _
DefaultVersion:=xlPivotTableVersionCurrent
Sheets("Inventory").Select
Cells(1, 1).Select


Can you help me figure out what I am doing incorrectly?
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,906
Members
452,366
Latest member
TePunaBloke

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