Removing buttons from a pivot table toolbar

D

dmitri9999

I am trying to use PivotTable.Buttons.Remove method to delete certain
buttons from a pivot table toolbar, but I do not seem to get the
right syntax.



pt.Toolbar.Buttons.Remove(1) returns the following error message:



"The best overloaded method match for 'MSComctlLib.IButtons.Remove(ref
object)' has some invalid arguments"



although I read in some posts that it is possible to specify an index of
a button as an argument



How else can I reference a button to remove it from the toolbar (I do
not know their names in the class).



Here is the C# code that preceeds the method call.



private OWC10.PivotTable pt;

....

this.pt=new OWC10.PivotTable;

....



Thank you in advance.

Dmitri.
 
T

Thao Moua [ms]

Try this

pt.Toolbar.Buttons.Remove((object) 1);

The message "The best overloaded method match
for 'MSComctlLib.IButtons.Remove(ref object)' has some
invalid arguments" does not mean you need to pass in an
object. All it meant was the parameter needed to be of
type object (aka variant.) So casting it will solve the
problem.


Thao Moua
OWC Webchart Support

This posting is provided "AS IS" with no warranties, and
confers no rights. Use of included script samples are
subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

-----Original Message-----

I am trying to use PivotTable.Buttons.Remove method to delete certain
buttons from a pivot table toolbar, but I do not seem to get the
right syntax.



pt.Toolbar.Buttons.Remove(1) returns the following error message:



"The best overloaded method match
for 'MSComctlLib.IButtons.Remove(ref
 

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

Top