Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamically Adding Textbox To Frame sarndt Excel Worksheet Functions 0 March 15th 10 06:19 PM
Progmatically adding controls in multipage Ajit Excel Programming 0 January 4th 05 09:39 PM
Adding checkbox within a frame Ajit Excel Programming 1 December 22nd 04 05:44 PM
need help understanding syntax for adding a page to multipage GregJG[_11_] Excel Programming 9 July 10th 04 11:20 AM
Adding components to multipage programatically Nigel Brown[_2_] Excel Programming 0 August 4th 03 10:25 AM


All times are GMT +1. The time now is 02:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"