Quantcast
Channel: Office 2013 and Office 365 ProPlus - Planning, Deployment, and Compatibility forum
Viewing all articles
Browse latest Browse all 3748

Getting Run-time Error '-2147024809 (80070057)' : the Pivottable Field Name is not valid

$
0
0

Hi,

I have a problem updating a Pivot Table with VBA. 

The code stops on the line :

Sheets(1).PivotTables("Pivottable1").ChangePivotCache ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:="C:\ANNE\EXCEL\[CMD - 2010.xlsm]Sheet2!R8C1:R2000C15", Version:=xlPivotTableVersion14)

but if I change the name of the file to "CMD2010.xlsm", then the following line does work : 

Sheets(1).PivotTables("Pivottable1").ChangePivotCache ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:="C:\ANNE\EXCEL\[CMD2010.xlsm]Sheet2!R8C1:R2000C15", Version:=xlPivotTableVersion14)

Please help me, as I my file is used my many users, and it's difficult to change the name.

Thanks,


Viewing all articles
Browse latest Browse all 3748

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>