Share via

Can't programmatically maximize VB editor

Anonymous
2012-02-23T04:31:52+00:00

In Word 2003, this line:

VBE.ActiveWindow.WindowState = vbext_ws_Maximize

used to work to maximize the VBE. It doesn't seem to anymore, in 2010.  The line doesn't throw an error, it just gets ignored..References include VBA Extensibility (5.3).

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Andreas Killer 144.1K Reputation points Volunteer Moderator
2012-02-28T17:28:19+00:00

Forget the reference, the reference is only related for the "vbext_ws_Maximize" constant.

You said: "the line is ignored", that means that your settings trust the VBA project is set properly, otherwise you'll get an RTE 6068.

Well, your description can only mean that the line is executed and works, but not in the way that you expected. .-)

Please execute this sub:

Sub Test()

  VBE.ActiveWindow.WindowState = 0

End Sub

As you see, the VBE is a multiple windows application, like Excel. With this property you can only size the window inside the VBE, not the VBE itself.

If you want to maximize the VBE itself, you must use the MainWindow object instead.

Sub Test()

  VBE.MainWindow.WindowState = vbext_ws_Maximize

End Sub

Andreas.

Was this answer helpful?

0 comments No comments

7 additional answers

Sort by: Most helpful
  1. Anonymous
    2012-02-28T06:29:38+00:00

    Yes, that is the file's size.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2012-02-28T06:20:39+00:00

    Hi,

    OK, please check if the size of file VBE6EXT.OLB is 40.0 KB (40, 960 bytes)?

    Library VBIDEPath:    C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLBDescription:    Microsoft Visual Basic for Applications Extensibility 5.3

    If not, try to copy from another PC.

    Best Regards,

    Cristin Yan

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2012-02-28T05:52:04+00:00

    Cristin - Your pictures don't show (in any of 3 browsers); but yes, that box is checked in the Macro Settings in the program options.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2012-02-28T05:10:40+00:00

    Hi,

    Please see if Trust access to the VBA project object model is checked according to the pictures below:

    Cheers,

    Cristin Yan

    Was this answer helpful?

    0 comments No comments