Showing NULL Command Bar handle

  • Thread starter chovatia.jaydeep
  • Start date
C

chovatia.jaydeep

Hi,

I want to fetch Excel Command Bar and Status bar handles. To get
handles, i have written following code:

Please assume that excel application is already opened on desktop
whose caption is "EXCEL_TEST".

------------------------------------------------------------------------------------------------------------------------------------------------
Line1: HWND hWndMainXLS = FindWindow("XLMAIN",
"EXCEL_TEST");
Line2: HWND hWndStatusBar = FindWindowEx(hWndXLDesk, 0,
"EXCEL4", NULL);
Line3: HWND hWndCommandBar = FindWindowEx(hWndXL, 0,
"MsoCommandBar", NULL);
------------------------------------------------------------------------------------------------------------------------------------------------

In above code, Line 1 and Line 2 successfully returns handler of main
excel sheet and status bar, but code in Line3 returns NULL handler. In
nutshell, above code doesn't return me the correct handler for
CommandBar.

Please let us know what is the problem in the code.

Thank You,
Jaydeep
 

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