creating pivot tables in Excel from Access
- From: "narina" <eeelllaaa@xxxxxxxxx>
- Date: 28 Jul 2005 07:11:22 -0700
Hello,
I have a problem with creating a pivot table in Excel from Access VBA.
I have wrote something like this:
.....
Dim objExcel As Object
dim vArkusz as String
Set objExcel = GetObject(, "Excel.Application")
(...)
vArkusz = "dane"
objExcel.ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase,
SourceData:= _
"objExcel.sheets(vArkusz).range(cells(1,1),cells(4,4))").CreatePivotTable
TableDestination:=objExcel.Range("A10"), _
TableName:="Tabela"
(...)
I get an error:
"Run-time error '5': Invalid procedure call or argument"
What do I do wrong?
Maybe the range (SourceData) should not look like I wrote?
Maybe there is another way to create pivot table?
I would be grateful for any help.
.......
narina
.
- Follow-Ups:
- Re: creating pivot tables in Excel from Access
- From: narina
- Re: creating pivot tables in Excel from Access
- Prev by Date: Problem with Embeded Queries
- Next by Date: Re: creating pivot tables in Excel from Access
- Previous by thread: Problem with Embeded Queries
- Next by thread: Re: creating pivot tables in Excel from Access
- Index(es):