G
Guest
Im using the DoCmd.TransferSpreadsheet method to create a worksheet in excel
then I use the CreateObject("Excel.Application") and xlApp.Workbooks.Open to
establish the environment . At this point I use
ActiveWorkbook.PivotCaches.Add(SourceType:=xlExternal) to create a pivot
table on the Access query.
..CreatePivotTable is working and the table does get created, but when I go to
ActiveSheet.PivotTables("PivotTable").AddFields, I get "add fields method of
Pivot Table Class failed with a run code error 1004."
I would have thought that when the .createPivotTable method worked, that
would have establish the environment for the .addfields methods, as well.
I need a nice pivot table which I can produce in Excel, but the data and all
supporting logic is in Access.
Do you have any thoughts on this other than doing it in Excel by using a MS
Query against the DB?
I appreciate any comments.
Lee
then I use the CreateObject("Excel.Application") and xlApp.Workbooks.Open to
establish the environment . At this point I use
ActiveWorkbook.PivotCaches.Add(SourceType:=xlExternal) to create a pivot
table on the Access query.
..CreatePivotTable is working and the table does get created, but when I go to
ActiveSheet.PivotTables("PivotTable").AddFields, I get "add fields method of
Pivot Table Class failed with a run code error 1004."
I would have thought that when the .createPivotTable method worked, that
would have establish the environment for the .addfields methods, as well.
I need a nice pivot table which I can produce in Excel, but the data and all
supporting logic is in Access.
Do you have any thoughts on this other than doing it in Excel by using a MS
Query against the DB?
I appreciate any comments.
Lee