View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
bocachai bocachai is offline
external usenet poster
 
Posts: 3
Default Change Pivot Table's query

Hi,

I'm trying to change the sql statement of a Pivot Table through VB6.
But, on the following line,
pt.PivotCache.sql =
StringToArray(ExcelWorkbook.Application.Substitute (pt.PivotCache.sql,
OldSQL, NewSQL))

I get the following error:
1004 - Application-defined or object-defined error

I've also tried with:
pt.PivotCache.CommandText =
StringToArray(ExcelWorkbook.Application.Substitute (pt.PivotCache.Command
Text, OldSQL, NewSQL))

but I get the same error. Any ideias?




*** Sent via Developersdex http://www.developersdex.com ***