I suspect I may have an issue with the wrong version of fm20.dll - 12.0.6510.5004. When I try to do something like :
.Add("MSForms.TextBox.1", "MyTextBox", Visible)
I receive an error for an invalid class string. Intellisense does confirm that .TextBox is not avialable - all displayed properties and methods are prefixed with "fm". I can see that there were some issues with this file during automatic updates. Does anybody have more info and the correct version, if appropriate?
Alan
Issue with MSForms (Office 2003, XP Pro)
-
- BronzeLounger
- Posts: 1545
- Joined: 26 Jan 2010, 11:36
- Location: Melbourne, Australia
-
- Administrator
- Posts: 78233
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Issue with MSForms (Office 2003, XP Pro)
Try
.Add("Forms.TextBox.1", "MyTextBox", Visible)
The ProgID strings for userform controls are all of the form Forms.typename.1
.Add("Forms.TextBox.1", "MyTextBox", Visible)
The ProgID strings for userform controls are all of the form Forms.typename.1
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1545
- Joined: 26 Jan 2010, 11:36
- Location: Melbourne, Australia
Re: Issue with MSForms (Office 2003, XP Pro)
Thanks Hans. Right on the money again. As you can tell, I'm rather rusty with my VBA . Now I'm curious where the MSForms fits in. What do all those properties & methods on the intellisense dropdown refer to?
thanks again
Alan
thanks again
Alan
-
- Administrator
- Posts: 78233
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Issue with MSForms (Office 2003, XP Pro)
MSForms is the class name of the object library, so you can use a declaration like this:
Dim obj As MSForms.TextBox
and typing MSForm followed by a period in the Visual Basic Editor will show the type names of controls; these are subclasses of the MSForms class.
When using the Add method to create a control, you have to specify the ProgID string of the control type; this is different from the above.
Dim obj As MSForms.TextBox
and typing MSForm followed by a period in the Visual Basic Editor will show the type names of controls; these are subclasses of the MSForms class.
When using the Add method to create a control, you have to specify the ProgID string of the control type; this is different from the above.
Best wishes,
Hans
Hans