Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Making a sound on condition of textbox
How can I get this code to work without having to select the object??
Private Sub TextBox1_Change() If TextBox1 24 Then ActiveSheet.Shapes("Object 3").Select Selection.Verb Verb:=xlPrimary Range("F1").Select End If End Sub I tried this but no such luck Private Sub TextBox1_Change() Dim Object As Object If TextBox1 24 Then With Object("Object 3") Application.Verb Verb:=xlPrimary End With End If End Sub This object is a sound I inserted, using insert object |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Making a sound on condition of textbox
Untested:
With Object("Object 3") .Verb Verb:=xlPrimary End With or just Object("Object 3").Verb Verb:=xlPrimary damorrison wrote: How can I get this code to work without having to select the object?? Private Sub TextBox1_Change() If TextBox1 24 Then ActiveSheet.Shapes("Object 3").Select Selection.Verb Verb:=xlPrimary Range("F1").Select End If End Sub I tried this but no such luck Private Sub TextBox1_Change() Dim Object As Object If TextBox1 24 Then With Object("Object 3") Application.Verb Verb:=xlPrimary End With End If End Sub This object is a sound I inserted, using insert object -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Making a sound on condition of textbox
Sorry Dave that doesn't work, maybe there is a way to globally name the
object? it apears, all the examples I found when I searched it, referrs to : ActiveSheet.Shapes("Object 3").Select Selection.Verb Verb:=xlPrimary which sucks because now you have to select the worksheet as well, and that takes me out of the userform |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Making a sound on condition of textbox
How about:
ActiveSheet.OLEObjects("object 3").Verb Verb:=xlPrimary or ActiveSheet.Shapes("Object 3").OLEFormat.Verb Verb:=xlPrimary damorrison wrote: Sorry Dave that doesn't work, maybe there is a way to globally name the object? it apears, all the examples I found when I searched it, referrs to : ActiveSheet.Shapes("Object 3").Select Selection.Verb Verb:=xlPrimary which sucks because now you have to select the worksheet as well, and that takes me out of the userform -- Dave Peterson |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Making a sound on condition of textbox
If you wanted a variable.
Dim OLEObj as OLEObject set Oleobj = ActiveSheet.OLEObjects("object 3") oleobj.verb verb:=xlprimary Dave Peterson wrote: How about: ActiveSheet.OLEObjects("object 3").Verb Verb:=xlPrimary or ActiveSheet.Shapes("Object 3").OLEFormat.Verb Verb:=xlPrimary damorrison wrote: Sorry Dave that doesn't work, maybe there is a way to globally name the object? it apears, all the examples I found when I searched it, referrs to : ActiveSheet.Shapes("Object 3").Select Selection.Verb Verb:=xlPrimary which sucks because now you have to select the worksheet as well, and that takes me out of the userform -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Making condition dynamic? | Excel Discussion (Misc queries) | |||
enhanced conditional formatting | Excel Discussion (Misc queries) | |||
Textbox moves position when Printing? | Excel Discussion (Misc queries) | |||
Legnth of text in textbox control | Excel Discussion (Misc queries) | |||
textbox scrollbar disappears | Excel Discussion (Misc queries) |