Home |
Search |
Today's Posts |
#1
|
|||
|
|||
VBA Code Windows
Is there any way to set the parameters (or change the default parameters) for
the various VBA windows - code, properties, etc. - to control where they display on the screen and their size? -- Bill @ UAMS |
#2
|
|||
|
|||
First, set a reference (VBA Editor Tools menu, References) to the
"Microsoft Visual Basic For Applications Extensibility 5.3" library. Then you can use the Window object to control the Window properties of a specified CodePane. With ThisWorkbook.VBProject.VBComponents("Module1").Cod eModule.CodePane.Window Debug.Print .Top, .Left, .Height, .Width End With -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "BillCPA" <Bill @ UAMS wrote in message ... Is there any way to set the parameters (or change the default parameters) for the various VBA windows - code, properties, etc. - to control where they display on the screen and their size? -- Bill @ UAMS |
#3
|
|||
|
|||
The solution below has worked for the code windows for VBA worksheets and
modules. It also works for the form 'code' window, but does not work for the form window - the window in which the form itself is displayed. Here is what I am using: For Each cmpComponent In cmpComponents cmpName = ThisWorkbook.VBProject.VBComponents(cmpComponent.N ame).Name ThisWorkbook.VBProject.VBComponents(cmpName).CodeM odule.CodePane.Window.Top = 12 .. .. .. next cmpComponent Is there something that needs to be specified (seems like you might use 'FormPane' instead of 'CodePane', but of course you don't) to get it to work for the form? I've always wondered if a response to an old question was posted, it would ever get noticed. I guess I'll find out. If I don't hear something in a couple of days, I'll try you on your web site. -- Bill @ UAMS "Chip Pearson" wrote: First, set a reference (VBA Editor Tools menu, References) to the "Microsoft Visual Basic For Applications Extensibility 5.3" library. Then you can use the Window object to control the Window properties of a specified CodePane. With ThisWorkbook.VBProject.VBComponents("Module1").Cod eModule.CodePane.Window Debug.Print .Top, .Left, .Height, .Width End With -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "BillCPA" <Bill @ UAMS wrote in message ... Is there any way to set the parameters (or change the default parameters) for the various VBA windows - code, properties, etc. - to control where they display on the screen and their size? -- Bill @ UAMS |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Make Change Case in Excel a format rather than formula | Excel Worksheet Functions | |||
Error trapped only while stepping through the code - Not triggered when run | Excel Discussion (Misc queries) | |||
Opening a file with code without a set file name | Excel Discussion (Misc queries) | |||
Opening a file with code without a set file name | Excel Discussion (Misc queries) | |||
Error trapped only while stepping through the code - Not triggered when run | Excel Discussion (Misc queries) |