View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
gstoa gstoa is offline
external usenet poster
 
Posts: 1
Default Excel TableDestination As String?

I've recorded an Excel macro which successfully creates a new pivot
table on mySheet.xls. For example:

ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase,
SourceData:="YIS!R2C1:R15C26").CreatePivotTable
TableDestination:="[mySheet.xls] YIS!R18C1", TableName:=PivotTable15,
DefaultVersion:=xlPivotTableVersion10

I need to be able to dynamically change the TableDestination value
from mySheet.xls to a string variable as my macro will be creating
pivot tables across multiple workbooks.

I've tried turning this into one big string using Chr$(34) for the
double quotes but can't seem to get this working correctly. Any
suggestions are welcomed!