View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel,microsoft.public.vstudio.extensibility
Ahmad Jalil Qarshi Ahmad Jalil Qarshi is offline
external usenet poster
 
Posts: 3
Default How to Get Reference of CommandBar in Excel?

hi!

i am using VC7 and Office 2003. I want to add a toolbar in EXCEL with some
buttons. i have done that for word already. First i get the reference of the
CommandBar using the following code.

HRESULT hr;

CComPtr<Office2003::_CommandBars spCmdBars;

//QI() for application.

CComQIPtr<MSWord::_Application spWordApp(m_pApplication);

ATLASSERT(spWordApp);

m_pWordApp = spWordApp;

hr = m_pWordApp-get_CommandBars(&spCmdBars);

so now when i try to do the same with Excel i receive an error message that
get_CommandBars is not member of m_pExcelApp.

i don't know how to do that.

so if any body knows about that then please help me. i m in hurry.

Thanks.

Ahmad Jalil Qarshi