ONe Macro won't call another

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All.........
I'm having a heck of a time with Excel97,SR2.

I have a macro which runs a MSQuery and returns data to my Excel sheet from
an outside database. It works fine when run by itself.

I have another macro which runs a Pivot Table on that data. It works fine
when run by itself.

When I try to call the second macro from the first, I get error message "Run
time error '1004', AddFields method of Pivot Table class failed". Yet each
macro will run individually and the whole thing will run if stepped through
from the beginning by hand. This combination of macros is for retrieving
Materials Data. I have another pair, very nearly the same which retireve
Labor Data and they run together just fine.

I've tried changing the name of the called macro, and using both "Call
PivotMaterials" and "Application.run "PivotMaterials"".....no difference.

Any help would be much appreciated...

Vaya con Dios,
Chuck, CABGx3
 
when you refresh the querytable, do you have the backgroundquery parameter
set to false?
 
I don't know if this will change anything, but have you tried just:

PivotMaterials

No Call or Application.Run.
 
Thanks Tom, that did the trick!!!!! You're a miracle-worker. The "good"
pair was set to false, the one that didn't work was set to true. Re-setting
it to false solved the problem. Thanking you very very much, kind Sir.

Vaya con Dios,
Chuck, CABGx3
 
Thanks for the thought PCLIVE, but Tom just hit the nail on the
head.......problem solved.

Vaya con Dios,
Chuck, CABGx3
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top