ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Updating large pivot source data (https://www.excelbanter.com/excel-programming/437015-updating-large-pivot-source-data.html)

Vepa

Updating large pivot source data
 
Hello,

I'm experiencing the following problem with a very simple macro in Excel
2007 to update pivot table data source. That is, my data has more than 74000
rows and I'm trying to update the source data with the following code:

Sub Macro1()
Dim rng1 As Range
Set rng1 = Sheets("Test_sheet").Range("A1:A74000")
ActiveSheet.PivotTables("Pivot-taulukko1").ChangePivotCache
ActiveWorkbook. _
PivotCaches.Create(SourceType:=xlDatabase, SourceData:=rng1, _
Version:=xlPivotTableVersion12)
End Sub

The problem is that the code works if the source data is less than 65536
rows long but if I change the source data to range to row 65537 the code
stops to work and I get an error Run time error '13' Type mismatch.

Could somebody now help me with this issues to get this issue fixed?

Best regards
Vepa



All times are GMT +1. The time now is 11:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com