数据透视表运行时错误1004 [英] pivot table runtime error 1004

查看:267
本文介绍了数据透视表运行时错误1004的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我在使用vba创建数据透视表时遇到问题...这是代码:

Hello, i have problem with creating pivot table using vba...this is the code:

    ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
        "Zdroj!R1C1:R" & Pocet & "C5", Version:=xlPivotTableVersion12).CreatePivotTable _
        TableDestination:="Vysledek!R1C1", TableName:="Kontingenční tabulka 2", _
        DefaultVersion:=xlPivotTableVersion12

每当我运行宏时,我收到此消息:运行时errror 1004 ...

every time when i run macro i receive this message: runtime errror 1004...

请帮我解决这个问题???

Please can you help me solve this issue???

非常感谢...

Mathew

推荐答案

您只能运行一次宏代码 - 因为那时你有pivotcache存在,不能再添加相同的。  尝试这种方式:

You can only run that macro code once - because then you have the pivotcache existing and cannot add the same one again.  Try it this way:


这篇关于数据透视表运行时错误1004的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆