I am trying to attach a tooltip (through hyperlink route) and a macro to an existing shape. The code is something like this -
I am calling this Sub on Workbook_Open. As I see, the tooltip gets assigned to the shape without any problem and also, the Macro name too seems to get assigned. BUT, on click of the shape, nothing happens, meaning, the assigned macro never gets called. If I comment out the tooltip assigning line, then macro gets called!!!
I did see similar macro not getting called problem being posted in a few places, but none of them seemed to provide a proper answer Help please?
Note: My Excel version is 2007.
P.S: I had submitted this as a response to another old thread. Posting it in a new thread realizing that the old one may not surface at all...
Code:
Sub testtooltip()
Dim myDocument As Worksheet
Dim shp As Shape
Dim strTooltip As String, strMacroName As String
Set myDocument = Sheets("MyDashboard")
strTooltip = "setting this tooltip - "
strMacroName = "'" & ActiveWorkbook.Name & "'" & "!" & "RefreshDashboard"
With myDocument
Set shp = .Shapes("shp_button_refresh")
.Hyperlinks.Add Anchor:=shp, Address:="", ScreenTip:=strTooltip
shp.OnAction = strMacroName
End With
End Sub
I did see similar macro not getting called problem being posted in a few places, but none of them seemed to provide a proper answer Help please?
Note: My Excel version is 2007.
P.S: I had submitted this as a response to another old thread. Posting it in a new thread realizing that the old one may not surface at all...
Last edited: