Excel vba automation: Assign macro to imported graphic
Posted on 2014-11-11
I assign a macro to a graphic that I have imported via xl_Ribbon/Insert/Picture :
Selection.OnAction = "tst"
BUT, if I import a graphic to an Excel cell, how do I identify that graphic so I can use vba to assign a macro to it?
With Range(Cells(rn.row + 1, 7), Cells(rn.row + 1, 1))
ActiveSheet.Shapes.AddPicture "path\x.jpg", msoCTrue, msoTrue, .left, .top, -1, -1
ActiveSheet.Shapes(ActiveSheet.Shapes.Count).height = .height
If you could briefly explain the principle of connecting input file name with
Shapes.Range, it would help me!
Thanks in anticipation