ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Progmatically adding controls in multipage (https://www.excelbanter.com/excel-programming/320077-progmatically-adding-controls-multipage.html)

Ajit

Progmatically adding controls in multipage
 
I am using the below code to add a frame on a form. Also i need to add
another frame to an alreading existing multipage. I could not refer to the
already existing multipage. Could anyone chip in the reference ...

Sub Add_Control_Testing(Workbook_Name As String, Form_Name As String)
' Declare variables.
Dim myform As Object
Dim myframe As Object

' to manipulate the UserForm.
Set mynewform =
Workbooks(template_Name).VBProject.VBComponents.It em(module_Name)

'Adding a frame
Dim mymultipage As Object
Set mymultipage = mynewform.Designer.Controls
Set myframe = mynewform.Designer.Controls.Add("Forms.Frame.1")
With myframe
.Name = "frame_1"
.Top = 180
.Left = 390
.Height = 60
.Width = 202
.BorderStyle = 1
End With
End Sub
--
Ajit


All times are GMT +1. The time now is 04:22 PM.

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