Automatically highlighting cells behind an embedded object

Jaymond

New Member
Joined
Sep 17, 2006
Messages
14
Hello everyone!

I'm having a hell of a time trying to get excel to automatically highlight the cells behind an embedded object when I have the object selected.

I have an embedded PDF file shown as an icon. What I would like to do is have the cells behind the icon fill in with red when I click on the icon. Then when I select another cell (deselect the icon), I want all the cells behind that icon to return to white. Is this even possible with excel?
 
I don't know if that solution will help, as all of my embedded objects are in another sheet. Which is why I was trying to have it set up so that I click on a cell in one sheet, it hyperlinks me to an embedded icon in another sheet, and the icon is automatically highlighted with its red border. Then if I want to move around to other icons on the sheet, the red border will only appear on the icon I have selected.

With the code you gave me, I'm still having problems whereby I can't open the embedded file by double clicking on the icon.

Hmmm, this is a tough one...
 
Upvote 0

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hi

Sorry, got me stumped!

Did doubleclick work before? What code was triggered when you did that?

I do not have much experience with pdfs. Maybe someone else reading this can help.

regards
Derek
 
Upvote 0
Yeah, double clicking on the cell worked before. It would open the file. Now it's disabled for some reason with the code. Weird.
 
Upvote 0
Hi
I just embedded a pdf file as an icon and assigned my macro to it and it still opened the pdf file when double-clicked.
Derek
 
Upvote 0
Hmmm,

Here is the code I have for the sheet:

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveSheet.DrawingObjects.ShapeRange.Line.Visible = msoFalse
Application.ScreenUpdating = True
End Sub


Here is the code I have for the module (assigned to each embedded PDF file):

Code:
Sub RedBorderToggle()
ActiveSheet.DrawingObjects.ShapeRange.Line.Visible = msoFalse
ActiveSheet.Shapes(Application.Caller).Line.Visible = Not ActiveSheet.Shapes(Application.Caller).Line.Visible
End Sub

Is there something wrong with the code?
 
Upvote 0
For some reason, when clicking on the icon, it's just showing the border, but it's not actually selecting the icon. When an icon is selected, it has the 8 little circles around it (so you can resize it), but with the code above, it doesn't actually select the icon. And there is no way to select the icon unless I right click on it.
 
Upvote 0
Hi

I find the doubleclick is very unreliable when you assign a macro to your icon. It seems to work okay when you use my "hyperlink" suggestion above - but it will not then highlight if you actually select the icon, only when you click on the "hyperlink" cell

Derek
 
Upvote 0
I can't believe you can't select an icon once you assign a macro to it. There has to be something we're missing...
 
Upvote 0
Presumably there is a doubleclick event inherent in the icon (to open the pdf file) which is voided when another macro is assigned to it. Try reposting your topic as a different question -- some guru out there will know the answer.

regards
Derek
 
Upvote 0

Forum statistics

Threads
1,216,178
Messages
6,129,326
Members
449,501
Latest member
Amriddin

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