Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding frame on multipage through code...
I have couple of 100 templates and i need to make a global change to all
(Need to add a frame on 3rd tab of the multipage). With the code below i am able to add frame on the form but could not figure out how to add the same frame on the 3rd tab of the multipage. Suggestions will be greaty appreciated. Sub Add_Control_Testing(Wkb_Name As String, Form_Name As String) ' Declare variables. Dim myForm As Object Dim myFrame As Object ' to manipulate the UserForm. Set myForm = Workbooks(Wkb_Name).VBProject.VBComponents.Item(Fo rm_Name ) 'Adding a frame Set myFrame = myForm.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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding frame on multipage through code...
I figured it out.
Sub Add_Control_Testing(Wkb_Name As String, Form_Name As String) ' Declare variables. Dim myForm As Object Dim myMultipage as Object Dim myFrame As Object ' to manipulate the UserForm. Set mynewform = Workbooks(template_Name).VBProject.VBComponents.It em(module_Name) Set myMultipage = mynewform.Designer.Controls.Item("Multipage1") 'Adding a frame to a multipage Set myframe = myMultipage(3).Controls.Add("Forms.Frame.1") With myframe .Name = "frame_Ahf" .Top = 350 .Left = 390 .Height = 60 .Width = 202 .BorderStyle = 1 End With End Sub "Ajit" wrote: I have couple of 100 templates and i need to make a global change to all (Need to add a frame on 3rd tab of the multipage). With the code below i am able to add frame on the form but could not figure out how to add the same frame on the 3rd tab of the multipage. Suggestions will be greaty appreciated. Sub Add_Control_Testing(Wkb_Name As String, Form_Name As String) ' Declare variables. Dim myForm As Object Dim myFrame As Object ' to manipulate the UserForm. Set myForm = Workbooks(Wkb_Name).VBProject.VBComponents.Item(Fo rm_Name ) 'Adding a frame Set myFrame = myForm.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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Dynamically Adding Textbox To Frame | Excel Worksheet Functions | |||
Progmatically adding controls in multipage | Excel Programming | |||
Adding checkbox within a frame | Excel Programming | |||
need help understanding syntax for adding a page to multipage | Excel Programming | |||
Adding components to multipage programatically | Excel Programming |