PC Review


Reply
Thread Tools Rate Thread

Debug, Please help

 
 
Michael
Guest
Posts: n/a
 
      20th Aug 2009
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

 
Reply With Quote
 
 
 
 
Michael
Guest
Posts: n/a
 
      20th Aug 2009
On Aug 20, 5:04*pm, Michael <michae...@gmail.com> 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 With Quote
 
Joel
Guest
Posts: n/a
 
      20th Aug 2009
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
>
>

 
Reply With Quote
 
Joel
Guest
Posts: n/a
 
      20th Aug 2009
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 <michae...@gmail.com> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
random Microsoft Visual C++ Debug Library Debug Error =?Utf-8?B?ZGNobWFu?= Microsoft Access VBA Modules 1 26th Apr 2006 03:25 PM
How to tell if your C# code is running in debug mode (debug compil =?Utf-8?B?TWF4IE0uIFBvd2Vy?= Microsoft C# .NET 3 20th Oct 2005 10:39 PM
V Studio 2003 Doesn't Load Supporting DLL Debug Symbols for Windows Service Remote Debug INGSOC Microsoft C# .NET 0 8th Feb 2005 09:19 AM
Debug Error - Microsoft Visual C ++ Debug Library =?Utf-8?B?THVrZXN0ZXI0Mg==?= Microsoft Outlook VBA Programming 5 23rd Nov 2004 01:19 AM
Visual C++ Debug Library. Debug Error! Abnormal program termination John Microsoft Outlook Discussion 1 25th Sep 2004 09:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:42 PM.