WxPython question re: embedded activex internet explorer and excel

Discussion in 'Python' started by jojoba, Mar 2, 2006.

  1. jojoba

    jojoba Guest

    Hi
    I currently am using an activex wrapper in wxpython to embed Internet
    Explorer in a wxPanel:

    IEmodule=win32com.client.gencache.EnsureModule('{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}',
    0,1,1)
    InternetExplorerActiveXClass = MakeActiveXClass(IEmodule.WebBrowser,
    eventObj = self)
    self.WebBrowser = InternetExplorerActiveXClass(self,
    -1)

    (where self is a wx.Panel)

    That was ok.
    However, I am creating multiple of these activex webbrowsers and
    putting them in a wx.Notebook, one per page (where each page is a
    wx.Panel).
    On each page, i load a different .xls excel file:

    self.WebBrowser.Navigate2(excelFilePath)

    Great. All the files load fine.
    Ok, here's the weird part.
    When i choose among the different tabs for the wx.Notebook, I can see
    all the excel files fine. I can go into each and edit them too. But for
    some reason, i can't get focus away from the last-loaded excel file.
    That is, I can really only see the cursor flashing in a worksheet excel
    if and only if i am in the last-loaded excel file.

    I tried self.WebBrowser.Document.Application.Workbooks[0].Activate() to
    activate another workbook (representing a different .xls file) but i
    get a win32com error saying the "Workbook Activate method failed"

    Is there any way for me to get out of this? Does anyone have any idea
    how to bring other workbooks into focus using this activex scheme? Or
    am i approaching this from the completely wrong angle?

    thanks to anyone who can get past this madness,
    jojoba
    jojoba, Mar 2, 2006
    #1
    1. Advertising

  2. jojoba

    David Pratt Guest

    Hi jojoba. I work with wxPython too but cannot answer this question.
    There is an active and friendly community of wxPython users on



    Robin Dunn, the lead person behind wxPython and others provide excellent
    advice and support on this list.

    Regards,
    David

    jojoba wrote:
    > Hi
    > I currently am using an activex wrapper in wxpython to embed Internet
    > Explorer in a wxPanel:
    >
    > IEmodule=win32com.client.gencache.EnsureModule('{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}',
    > 0,1,1)
    > InternetExplorerActiveXClass = MakeActiveXClass(IEmodule.WebBrowser,
    > eventObj = self)
    > self.WebBrowser = InternetExplorerActiveXClass(self,
    > -1)
    >
    > (where self is a wx.Panel)
    >
    > That was ok.
    > However, I am creating multiple of these activex webbrowsers and
    > putting them in a wx.Notebook, one per page (where each page is a
    > wx.Panel).
    > On each page, i load a different .xls excel file:
    >
    > self.WebBrowser.Navigate2(excelFilePath)
    >
    > Great. All the files load fine.
    > Ok, here's the weird part.
    > When i choose among the different tabs for the wx.Notebook, I can see
    > all the excel files fine. I can go into each and edit them too. But for
    > some reason, i can't get focus away from the last-loaded excel file.
    > That is, I can really only see the cursor flashing in a worksheet excel
    > if and only if i am in the last-loaded excel file.
    >
    > I tried self.WebBrowser.Document.Application.Workbooks[0].Activate() to
    > activate another workbook (representing a different .xls file) but i
    > get a win32com error saying the "Workbook Activate method failed"
    >
    > Is there any way for me to get out of this? Does anyone have any idea
    > how to bring other workbooks into focus using this activex scheme? Or
    > am i approaching this from the completely wrong angle?
    >
    > thanks to anyone who can get past this madness,
    > jojoba
    >
    David Pratt, Mar 2, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Patrice Vogel
    Replies:
    0
    Views:
    511
    Patrice Vogel
    Mar 7, 2005
  2. dlcf123
    Replies:
    0
    Views:
    326
    dlcf123
    Jun 1, 2006
  3. Peter Wlodarczak
    Replies:
    1
    Views:
    463
    mlimber
    May 25, 2006
  4. Replies:
    3
    Views:
    253
    Randy Webb
    Oct 24, 2005
  5. Replies:
    1
    Views:
    95
Loading...

Share This Page