Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 91
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 91
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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
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
Making condition dynamic? aposatsk Excel Discussion (Misc queries) 3 August 16th 06 01:43 PM
enhanced conditional formatting Stuart Excel Discussion (Misc queries) 13 November 13th 05 07:20 PM
Textbox moves position when Printing? Rugdoody Excel Discussion (Misc queries) 1 September 21st 05 09:42 PM
Legnth of text in textbox control rgarber50 Excel Discussion (Misc queries) 3 July 15th 05 02:18 PM
textbox scrollbar disappears Yaniv Excel Discussion (Misc queries) 1 June 20th 05 11:31 PM


All times are GMT +1. The time now is 02:00 PM.

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"