ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Modify excel userform controls through vbproject? (https://www.excelbanter.com/excel-programming/288614-modify-excel-userform-controls-through-vbproject.html)

daithimcc[_3_]

Modify excel userform controls through vbproject?
 
(Excel vX for Macintosh)
Does anyone know if it is possible to set properties of controls on an
excel userform using the vbproject. I know I can set the textbox
heights etc... at run-time, but as there are many changes I want to
make to many controls I wonder if there is any quick way of doing this
in the VB editor (without using the normal interface, which would be
quite slow).
I can get the userform as a vbcomponent using
thisworkbook.vbproject.vbcomponents("formname") but I can't seem to do
what I want with this. Is there any way of returning the userform
object via the vbproject?
Thanks
David


---
Message posted from http://www.ExcelForum.com/


Chip Pearson

Modify excel userform controls through vbproject?
 
David,

You need to use the Designer object of the form. For example, the
following will set the height of CommandButton1 to 48.

With ThisWorkbook.VBProject.VBComponents("UserForm1").D esigner
.Controls("CommandButton1").Height = 48
End With

I have no idea is this will work on a Macintosh.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"daithimcc " wrote in
message ...
(Excel vX for Macintosh)
Does anyone know if it is possible to set properties of

controls on an
excel userform using the vbproject. I know I can set the

textbox
heights etc... at run-time, but as there are many changes I

want to
make to many controls I wonder if there is any quick way of

doing this
in the VB editor (without using the normal interface, which

would be
quite slow).
I can get the userform as a vbcomponent using
thisworkbook.vbproject.vbcomponents("formname") but I can't

seem to do
what I want with this. Is there any way of returning the

userform
object via the vbproject?
Thanks
David


---
Message posted from http://www.ExcelForum.com/




daithimcc[_4_]

Modify excel userform controls through vbproject?
 
Yes this works on the Macintosh. Thanks a lot - it does the job
perfectly. Is there a source you can recommend covering all of these
more obscure features?
Thanks again.
David


---
Message posted from http://www.ExcelForum.com/



All times are GMT +1. The time now is 08:48 PM.

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