Invalid Procedure Call or Arguement When changing Page item in Pivot table

lala14b

New Member
Joined
Sep 24, 2008
Messages
20
Please help. I have recorded vb that changes a page item in a pivot table when selecting from a combo box - similar to this video.

http://www.datapigtechnologies.com/flashfiles/pivot10.html

The recorded code that vb gives me works only if it's selecting the selection that was chosen when recorded or if it was manually selected right before I choose the drop down item. Otherwise, it gives an invalid procedure call or arguement - runtime error 5.

This occurs in 2007 or compatibility mode. I think this is a new problem since it used to work okay for me.

Does anyone know what's going on??
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
If it's a pagefield, then that should work (assuming valid data). If it's a row or column field, it won't.
 
Upvote 0
Yes, it's a page field, and it's not working. It's the strangest thing. I just deleted teh pivot and recreated it (it's the same as the other on the same tab with quarter being the field selected instead of period), and it seems to be working for the time being. Maybe it was somehting in the pivot itself.

I have pivottable1, 2 and 3 on several different tabs that i need to select the same criterea on. Is there a way to do this in 1 simple line of code, or do i need to select tab, run macro, select tab, run macro until it's complete? For some reason I keep getting "not enough memory" error messages now when I try to select my drop down. The file is only 3 mb, and I'm working on a network with plenty of space.

On another note, do you know of any vb training classes that are worthwhile? I have tried to browse through some books, but in a lot of cases, examples provided aren't exactly what i'm looking for, and i get stuck tweaking the code since I don't truly understand the language.
 
Upvote 0
I've never taken any, so I couldn't really say - I just read books and experiment.
 
Upvote 0

Forum statistics

Threads
1,224,847
Messages
6,181,334
Members
453,032
Latest member
Pauh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top