ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   help --- Commandbars (https://www.excelbanter.com/excel-programming/353382-help-commandbars.html)

Wayne

help --- Commandbars
 
Hi,

Could someone tell me why
MsgBox Application.CommandBars("Cell").Controls("Insert.. .").ID
is giving me a invalid procedure call or argument error.

I'm actually trying to disable insert and delete from Cell and Row right
click.

The delete is working fine
Application.CommandBars("Cell").Controls("Delete.. .").enable = False, but
insert gives me the error....

Help
wAyne_

Bob Phillips[_6_]

help --- Commandbars
 
Works fine for me.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"wAyne" wrote in message
...
Hi,

Could someone tell me why
MsgBox Application.CommandBars("Cell").Controls("Insert.. .").ID
is giving me a invalid procedure call or argument error.

I'm actually trying to disable insert and delete from Cell and Row right
click.

The delete is working fine
Application.CommandBars("Cell").Controls("Delete.. .").enable = False, but
insert gives me the error....

Help
wAyne_




Ron de Bruin

help --- Commandbars
 
I think you delete it

Run this one time
Application.CommandBars("Cell").Reset

And then try this

Application.CommandBars("Cell").FindControl(ID:=31 81).Enabled = False
Application.CommandBars("Cell").FindControl(ID:=29 2).Enabled = False




--
Regards Ron de Bruin
http://www.rondebruin.nl


"wAyne" wrote in message ...
Hi,

Could someone tell me why
MsgBox Application.CommandBars("Cell").Controls("Insert.. .").ID
is giving me a invalid procedure call or argument error.

I'm actually trying to disable insert and delete from Cell and Row right
click.

The delete is working fine
Application.CommandBars("Cell").Controls("Delete.. .").enable = False, but
insert gives me the error....

Help
wAyne_




Wayne

help --- Commandbars
 
Hi,

I thought that might be the case -- I had it reset in an earlier part of the
code -- moved it to just before and had the same problems. I then copied
part of the code to a new workbook -- still same result -- even using the IDs
you provided (thanks Ron), I still end up with the same error.....
aaaarrrggghhhh!!

here is my sample code....

Sub test()

Application.CommandBars("Cell").Reset

Application.CommandBars("Cell").FindControl(ID:=29 2).Enabled = False

Application.CommandBars("Cell").Controls("Delete.. .").Enabled = False
Application.CommandBars("Cell").Controls("Insert.. .").Enabled = False

Application.CommandBars("Cell").FindControl(ID:=31 81).Enabled = False

End Sub


Thanks
wAyne_

"Ron de Bruin" wrote:

I think you delete it

Run this one time
Application.CommandBars("Cell").Reset

And then try this

Application.CommandBars("Cell").FindControl(ID:=31 81).Enabled = False
Application.CommandBars("Cell").FindControl(ID:=29 2).Enabled = False




--
Regards Ron de Bruin
http://www.rondebruin.nl


"wAyne" wrote in message ...
Hi,

Could someone tell me why
MsgBox Application.CommandBars("Cell").Controls("Insert.. .").ID
is giving me a invalid procedure call or argument error.

I'm actually trying to disable insert and delete from Cell and Row right
click.

The delete is working fine
Application.CommandBars("Cell").Controls("Delete.. .").enable = False, but
insert gives me the error....

Help
wAyne_





Wayne

help --- Commandbars
 

Thanks Again Ron,
It worked well in my main program...
wAyne_

Ron de Bruin

help --- Commandbars
 
Thanks for the feedback

--
Regards Ron de Bruin
http://www.rondebruin.nl


"wAyne" wrote in message ...

Thanks Again Ron,
It worked well in my main program...
wAyne_





All times are GMT +1. The time now is 07:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com