Prev: find a non-empty cell
Next: Sort bug on Excel 2007
From: Bo Zhu on 29 Apr 2010 06:35 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").Controls("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
|
Pages: 1 Prev: find a non-empty cell Next: Sort bug on Excel 2007 |