Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Workbook Window Handle

Status
Not open for further replies.

Hexonx

Programmer
Jan 10, 2001
102
US
Does anyone know how to obtain the window handle of a Workbook window? By enumerating child windows of the Excel application window, I've determined the windows classname to be "EXCEL7", but calling FindWindow and FindWindowEx (with various parm configurations) yields nothing. Any ideas?

What I want to do is to set the workbook window into a Visual Basic window. I've seen it done by using the Excel Application main window, but this requires an instance of Excel for each window I want to show. Because of this, I'd like to use the workbook windows instead so that I have a single instance of Excel application.
 
Thanks bodhi, that was helpful. I had code working by enumerating all child windows of the XLMAIN window class until I found window class EXCEL7. The code you pointed to is more efficient, since I don't have to enumerate windows at all.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top