Image & Sound in Cell

Bob Morrison

New Member
Joined
Dec 11, 2009
Messages
31
In XL 2010 is it possible to have a picture in a Cell and it plays an Audio file if you click on it?
 
Sorry Worf but it doesn't do anything.

Don't know what I'm doing wrong.

I'll try and attach a screenshot of of the macro as I've set it up.
 
Last edited by a moderator:
Upvote 0

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Like this:

Code:
' sheet module


Public Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, _
ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long


Sub OpenPlay()
Dim fp$, lngErr&
fp = "C:\Users\pc\Desktop\Rex's Stuff\Chair.wma"
lngErr = ShellExecute(0, "OPEN", fp, "", "", 0)
End Sub
 
Upvote 0
You're a legend Worf it works! :)

Hope somebody can delete post #11, I think I must have pasted the image not the link. :(
 
Upvote 0
Is there a way to do this without any pictures (so just clicking on any empty cell in the active workbook) and using the 'Say This' command? I've been playing around with the following code:

Sub SayThis()
Dim SayThis As String
If ActiveCell <> "A1" Then
SayThis = "Ouch."
Application.Speech.Speak (SayThis)
End If
End Sub

I basically want to set up the workbook so that the user gets told off by Excel for clicking on cells (so if they continue to click anywhere in the workbook, Excel gets more annoyed).
 
Last edited:
Upvote 0
Like this?

Code:
' sheet module


Private Sub Worksheet_SelectionChange(ByVal Target As Range)


If Target.Address <> Range("a1").Address Then Application.Speech.Speak "Ouch"


End Sub
 
Upvote 0

Forum statistics

Threads
1,216,322
Messages
6,130,045
Members
449,554
Latest member
andyspa

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top