LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Pivot Table Automation

is MyString_s valid?

in the immediate window you could try
Range(MyString_s ).Select
with the sheets it references as the active sheet.

"Kirk P." wrote:

I've got a procedure written to automate the creation of a pivot table. I'm
getting a "run-time error 13: type mismatch" error on the last line of the
code snippet below. The code works perfectly on one pivot table, so I copied
the code to use on another pivot table and I get this run time error. Any
ideas?

Dim WSD_s As Worksheet
Dim PTCache_s As PivotCache
Dim PT_s As PivotTable
Dim PRange_s As Range
Dim MyString_s As String

'Insert a new worksheet and name it
Set WSD_s = ActiveWorkbook.Worksheets.Add
WSD_s.Name = "PivotTable"

MyString_s =
"=OFFSET(SITE_COMPARE_DETAIL!$A$1,0,0,COUNTA(SITE_ COMPARE_DETAIL!$A:$A),COUNTA(SITE_COMPARE_DETAIL!$ 1:$1))"
Set PRange_s = Range(MyString_s)

Set PTCache_s = ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase,
SourceData:=PRange_s)

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Table Automation OdAwG Excel Discussion (Misc queries) 14 March 4th 07 07:33 PM
Pivot Table Automation Jonathan Excel Programming 1 July 11th 06 09:21 PM
problem with pivot table automation using perl [email protected] Excel Programming 0 March 21st 06 08:33 PM
Pivot Table Vba Automation In 2002 Barolo Excel Programming 0 August 18th 04 07:31 PM
Pivot Table Automation Questions JV[_2_] Excel Programming 1 June 3rd 04 12:52 PM


All times are GMT +1. The time now is 08:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"