![]() |
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 |
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 |
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 |
All times are GMT +1. The time now is 02:18 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com