Thread: CommandText
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Simon Shaw Simon Shaw is offline
external usenet poster
 
Posts: 60
Default CommandText

that is what I had when I got the error... still trying things... no success
yet...

"Tom Ogilvy" wrote:

Yes, that is what I mean.

--
Regards,
Tom Ogilvy


"Simon Shaw" <simonATsimonstoolsDOTcom wrote in message
...
qualify?

do you mean:

With Workbooks("Report Template.xls").PivotCaches(1)
.CommandType = xlCmdSql
.CommandText = Array("SELECT ACCOUNT_NO, ACCOUNTING_DATE, AMOUNT,
APPROVAL, BASE_CURR_AMOUNT, CHART_ID, ", _ etc...



"Tom Ogilvy" wrote:

Shouldn't you qualify PivotCache(1)

--
Regards,
Tom Ogilvy

"Simon Shaw" <simonATsimonstoolsDOTcom wrote in message
...
Hi,

I am trying to pass a String of SQL code into
Pivotcache(1).CommandText = Array (...., ..., ..., etc)

I keep getting the error message: Run-time error '1004'
Application-defined
or object error. clicking Help doesn't tell me anything.

I have successfully passed SQL into the CommandText before, I thought

I
got
it to work by limiting the length of each element of the array...

When I take the SQL I am trying to pass in to the CommandText and

paste it
directly into MS Query behind the PivotTable it works fine. so I know

the
SQL
code is valid.

Ideas?

Thanks

Simon Shaw