![]() |
|
#4
|
|||
|
|||
|
Hi Graham,
with a little tweak, i have been able to get this to change the buttons on the Canvas. It will set the actual button names in the properties. Code:
Sub CanvasButtons()
'Graham Mayor - www.gmayor.com
Dim oFrm As New UserForm1
Dim Arr() As Variant
Dim oCtrl As Object
Dim i As Long
Arr = xlFillArray(strWorkbook, strSheet)
With ThisDocument.VBProject.vbComponents("UserForm1").Designer
For i = 0 To UBound(Arr, 2)
For Each oCtrl In .Controls
If oCtrl.Name = Arr(3, i) Then
oCtrl.Caption = Arr(4, i)
oCtrl.Height = 100
oCtrl.Width = 300
oCtrl.BackColor = RGB(0, 127, 127)
ElseIf oCtrl.Name = Arr(5, i) Then
oCtrl.Caption = Arr(6, i)
' I may add lots more ElseIfs :)
End If
Next oCtrl
Next i
'.Show
End With
lbl_Exit:
'Set oCtrl = Nothing
Exit Sub
End Sub
![]() Happy coding Sunday dan solved |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Captions: Changing captions in Appendix update all captions
|
carnestw | Word | 3 | 10-27-2015 12:34 PM |
| Can't update/refresh embedded Excel file with Power Point 2010 command button | mt1013 | PowerPoint | 0 | 06-17-2015 05:18 AM |
| VBA Code in a UserForm module to delete a Command Button which opens the userform | Simoninparis | Word VBA | 2 | 09-21-2014 03:50 AM |
| UserForm Search with multiple TextBoxes | johndough | Excel Programming | 0 | 05-10-2014 12:11 PM |
| VBA code to update record in Access 2003 using Userform in Excel | primmer3001 | Excel Programming | 0 | 08-29-2011 04:25 PM |