Results 1 to 4 of 4
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBE Code Pane vs. Object Pane (Word 97SR2)

    The code below, when called from a VBA routine, will close
    all open VBA IDE code panes, but leaves any form object
    panes open. Why? What change can I make to insure that
    *ALL* IDE window panes are closed by this code?

    Sub CloseAllCodePanes()
    Dim wp As Object
    'Dim wp As VBIDE.Window
    For Each wp In Application.VBE.Windows
    Select Case wp.Type
    Case 0, 1
    wp.Close
    End Select
    Next
    End Sub
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBE Code Pane vs. Object Pane (Word 97SR2)

    Well, I take that back. The only userform object pane that does not close is the one displayed by the running code. I guess I can live with that.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: VBE Code Pane vs. Object Pane (Word 97SR2)

    Kevin,

    I tried your code as is without any change and it closed all codepanes, including ThisDocument, Userform and general module code panes.

    I tried it in both Office XP & 2000. So unless it is a problem with Office 97, I have no idea of why you are having difficulties.

    Andrew

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBE Code Pane vs. Object Pane (Word 97SR2)

    See my post that posted only seconds before you reponded. Thanks Andrew.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •