Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Click Excel custom menu item via MFC automation

Hi,

I have a question regarding custom Excel 2003 menu item click via MFC
automation.

The VBA version of the action I want to do is pretty straightforward:
Application.CommandBars(1).Controls("NumeriX").Con trols("Object
Tools").Controls("Delete All Objects").Execute

Now I need to translate the above line to C++ code. I already have the
automation classes for CCommandBars, CCommandBar0, CCommandBarControls,
CCommandBarControl classes generated by VS.NET 2003 class wizard.

The interesting thing is that the get_Item() method of CCommandBarControls
class returns a CCommandBarControl object, while in the VBA version another
CCommandBarControls object should be returned as the menu contains sub-menus.
Also I'm not so clear about the item index usage. From my preliminary
testing, the number returned by get_Count() method of CCommandBarControls
class is not equal to the number of visable menus on Excel menu bar.

Hope someone can clarify my doubt. Thanks!

Best regards,

Bo ZHU
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot click twice on custom menu in Excel Gerry Excel Programming 0 September 7th 07 01:06 AM
Custom Menu item disappeared in Excel 2007 rjr1040 Excel Programming 3 April 1st 07 03:29 AM
Excel 2000 Custom Menu Item Larry Bird Excel Discussion (Misc queries) 0 November 8th 05 08:25 PM
Persistent menu item with Excel Automation Add-in? [email protected] Excel Programming 2 January 10th 05 05:51 PM
Adding a menu item right click menu when clicking on a single. Andoni[_28_] Excel Programming 0 September 2nd 04 10:23 PM


All times are GMT +1. The time now is 12:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"