szita2000
Board Regular
- Joined
- Apr 25, 2012
- Messages
- 101
- Office Version
- 365
- Platform
- Windows
Hi Guys.
I am in the middle of building a pastein sheet which will check for duplicates before the pasted in data is processed.
As part of this I placed a "Show" button next to each row pasted in. The show button will bring out the matches and display it below the pasted in area in a split window.
Up until this is working.
Now I also have to place either a radio button or a toggle button so the person can decide to upload the row or discard it at the final submission.
I noticed that toggle buttons are OLEObjects so I declared my "Togglebutton" as OleObject
Then used this code to add the toggle button: (It is inside of a loop. cl giving us the row.)
It does place the button, but it craps out with object doesn't support this method. I believe at the Caption line.
My questions are:
Does toggle buttons using the textframe.text method?
I have seen some posts that claiming it is only a caption. That I can change based on the value.
Also if my toggle button will have the same .OnAction property?
Thanks
Thomas
I am in the middle of building a pastein sheet which will check for duplicates before the pasted in data is processed.
As part of this I placed a "Show" button next to each row pasted in. The show button will bring out the matches and display it below the pasted in area in a split window.
Up until this is working.
Now I also have to place either a radio button or a toggle button so the person can decide to upload the row or discard it at the final submission.
I noticed that toggle buttons are OLEObjects so I declared my "Togglebutton" as OleObject
Then used this code to add the toggle button: (It is inside of a loop. cl giving us the row.)
VBA Code:
'===============Button Placement========================
'Adding the show button
Set ShowButton = Sheet2.Buttons.Add(Top:=cl.Offset(0, 14).Top, Left:=cl.Offset(0, 14).Left, Height:=cl.Offset(0, 14).Height, Width:=cl.Offset(0, 14).Width)
With ShowButton
.Caption = "SHOW"
.OnAction = "Showme"
End With
'Adding the toggle buttons
Set Togglebutton = Sheet2.OLEObjects.Add(ClassType:="Forms.ToggleButton.1", Link:=False, _
DisplayAsIcon:=False, Top:=cl.Offset(0, 15).Top, Left:=cl.Offset(0, 15).Left, Height:=cl.Offset(0, 15).Height, Width:=cl.Offset(0, 15).Width)
With Togglebutton
[B].Caption = "TEST"[/B]
.Font.Size = 10
.Value = 0
End With
'===============Button Placement End====================
It does place the button, but it craps out with object doesn't support this method. I believe at the Caption line.
My questions are:
Does toggle buttons using the textframe.text method?
I have seen some posts that claiming it is only a caption. That I can change based on the value.
Also if my toggle button will have the same .OnAction property?
Thanks
Thomas