Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Debug, Please help

Hi,

Could anyone please help with the following code. When I ran it, it
said: "Error 1004"

ActiveSheet.PivotTableWizard SourceType:=xlExternal,
SourceData:=Sqlstring, tablename:="Table1"

Thanks a lot!!

Michael

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Debug, Please help

On Aug 20, 5:04*pm, Michael wrote:
Hi,

Could anyone please help with the following code. When I ran it, it
said: "Error 1004"

ActiveSheet.PivotTableWizard SourceType:=xlExternal,
SourceData:=Sqlstring, tablename:="Table1"

Thanks a lot!!

Michael



I figured out the code now. Now Could anyone please post some code
when I wanan change the SQL in an existing pivottable to get it
refreshed? Thanks a lot. Mike

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Debug, Please help

The code can't find tablename or source data is not in R1C1 format.


1) If Table range is a named range then try this

from
ActiveSheet.PivotTableWizard SourceType:=xlExternal,
SourceData:=Sqlstring, tablename:="Table1"

to
ActiveSheet.PivotTableWizard SourceType:=xlExternal,
SourceData:=Sqlstring, tablename:=Range("Table1")


2) Make sure source data is in R1C1 format
"Consolidation!R1C1:R2C2"


"Michael" wrote:

Hi,

Could anyone please help with the following code. When I ran it, it
said: "Error 1004"

ActiveSheet.PivotTableWizard SourceType:=xlExternal,
SourceData:=Sqlstring, tablename:="Table1"

Thanks a lot!!

Michael


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Debug, Please help

Can you show a sample of the SQL that you are referreing to? Maybe record a
macro while manually creattig the table and posting the code.

"Michael" wrote:

On Aug 20, 5:04 pm, Michael wrote:
Hi,

Could anyone please help with the following code. When I ran it, it
said: "Error 1004"

ActiveSheet.PivotTableWizard SourceType:=xlExternal,
SourceData:=Sqlstring, tablename:="Table1"

Thanks a lot!!

Michael



I figured out the code now. Now Could anyone please post some code
when I wanan change the SQL in an existing pivottable to get it
refreshed? Thanks a lot. Mike


Reply
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
Debug this Al Excel Programming 0 November 14th 06 07:16 PM
help with debug Rusty New Users to Excel 3 February 2nd 05 03:16 AM
Debug VBA Paul Cowan Excel Programming 0 December 9th 04 01:11 PM
* How do we debug this? ... Kris Excel Programming 2 October 29th 04 02:17 AM
No debug box mushy_peas[_33_] Excel Programming 2 April 23rd 04 12:20 AM


All times are GMT +1. The time now is 02:55 AM.

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

About Us

"It's about Microsoft Excel"