ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Window Manipulation (https://www.excelbanter.com/excel-programming/429185-window-manipulation.html)

BillCPA

Window Manipulation
 
Using the following code, I can change the size and location of the windows
in the VBA Editor that display the VBA code and forms. Is there some way to
do the same with the other windows - project window, watch window, etc.?

ThisWorkbook.VBProject.VBComponents(name).CodeModu le
ThisWorkbook.VBProject.VBComponents(name).Designer Window

--
Bill @ UAMS

Jacob Skaria

Window Manipulation
 
Application.VBE.Windows("Immediate")
Application.VBE.Windows("Watches")
Application.VBE.Windows("Project - VBAProject")

If this post helps click Yes
---------------
Jacob Skaria


"BillCPA" wrote:

Using the following code, I can change the size and location of the windows
in the VBA Editor that display the VBA code and forms. Is there some way to
do the same with the other windows - project window, watch window, etc.?

ThisWorkbook.VBProject.VBComponents(name).CodeModu le
ThisWorkbook.VBProject.VBComponents(name).Designer Window

--
Bill @ UAMS


Chip Pearson

Window Manipulation
 
You can get a reference to these window with code like the following.
Once you have the reference, you can move and size them as you like.

Dim ImmWindow As VBIDE.Window
Dim WatchWindow As VBIDE.Window
Dim ProjectWindow As VBIDE.Window
Dim W As VBIDE.Window

For Each W In Application.VBE.Windows
Select Case W.Type
Case vbext_wt_Immediate
Set ImmWindow = W
Case vbext_wt_Watch
Set WatchWindow = W
Case vbext_wt_ProjectWindow
Set ProjectWindow = W
Case Else
' ignore
End Select
Next W

Debug.Print ImmWindow.Caption, ImmWindow.Visible
Debug.Print WatchWindow.Caption, WatchWindow.Visible
Debug.Print ProjectWindow.Caption, ProjectWindow.Visible

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Sat, 30 May 2009 11:25:01 -0700, BillCPA <Bill @ UAMS wrote:

Using the following code, I can change the size and location of the windows
in the VBA Editor that display the VBA code and forms. Is there some way to
do the same with the other windows - project window, watch window, etc.?

ThisWorkbook.VBProject.VBComponents(name).CodeModu le
ThisWorkbook.VBProject.VBComponents(name).Designer Window


BillCPA

Window Manipulation
 
Thank you - you certainly know your stuff.

--
Bill @ UAMS


"Chip Pearson" wrote:

You can get a reference to these window with code like the following.
Once you have the reference, you can move and size them as you like.

Dim ImmWindow As VBIDE.Window
Dim WatchWindow As VBIDE.Window
Dim ProjectWindow As VBIDE.Window
Dim W As VBIDE.Window

For Each W In Application.VBE.Windows
Select Case W.Type
Case vbext_wt_Immediate
Set ImmWindow = W
Case vbext_wt_Watch
Set WatchWindow = W
Case vbext_wt_ProjectWindow
Set ProjectWindow = W
Case Else
' ignore
End Select
Next W

Debug.Print ImmWindow.Caption, ImmWindow.Visible
Debug.Print WatchWindow.Caption, WatchWindow.Visible
Debug.Print ProjectWindow.Caption, ProjectWindow.Visible

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Sat, 30 May 2009 11:25:01 -0700, BillCPA <Bill @ UAMS wrote:

Using the following code, I can change the size and location of the windows
in the VBA Editor that display the VBA code and forms. Is there some way to
do the same with the other windows - project window, watch window, etc.?

ThisWorkbook.VBProject.VBComponents(name).CodeModu le
ThisWorkbook.VBProject.VBComponents(name).Designer Window




All times are GMT +1. The time now is 05:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com