View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bernard[_3_] Bernard[_3_] is offline
external usenet poster
 
Posts: 1
Default Creating a PivotTable in a Different Workbook

I have been trying to create the PivotTable in a different
Workbook than the one containing the Macro and the source
data, but I have an error every time.

ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase,
SourceData:= "Database").CreatePivotTable
TableDestination:="[Test.xls]Sheet1!R3C1",
TableName:="PivotTable1"

I would like to have the table in the file Test.xls
Is there a solution?

Thanks for your help