This question is not for any specific macro code but generalized.
I have Excel 2016 and writing many macros in that. the macros are working fine if we run it in Excel 2016, but I got messages from others that the same macros are throwing error since they are using Excel 2010. Since I don't have 2010, I can not debug and find the error line.
Is there any compatibility chart or method available where I can check if code written by me in Excel 2016 will work in old Excel versions or not?
Thanks,
I suspect the following code line:
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:=PRange, Version:=6).CreatePivotTable TableDestination:="PivotTable!R1C1", TableName:="PivTab1", DefaultVersion:=6
I also changed the same line to following:
Set PSheet = Worksheets("PivotTable")
Set PCache = ActiveWorkbook.PivotCaches.Create(xlDatabase, Sheets("Temp_Data_Sheet").UsedRange)
Set PTable = PCache.CreatePivotTable(PSheet.Range("A1"), TableName:="PivTab1")