Excel 2007 Macro to add photo

  BrendanKK 06 Feb 12
Locked

I have created a macro to add a photo to an Excel 2007 workshet and added a link to the macro to the Quick Access Toolbar. However when I click the icon on the Quick Access Toolbar to add the picture, nothing happens.

The same procedure works fine in Word 2007. What is different with Excel?

  Noldi 06 Feb 12

I think if you copy and paste your macro on here I'm sure somebody will sort it out.

Noldi

  BrendanKK 17 Feb 12

I create macro using the following steps: DEVELOPER Tab > Record Macro > (Input Macro name "Signature" ) > OK INSERT Tab > Picture > (Click on "Signature" picture file to import) DEVELOPER Tab > Stop Recording.

The Macro reads as follows

Sub Signature() ' ' Signature Macro '

' End Sub

When I run Macro nothing happens

  VoG II 17 Feb 12

The macro recorder has not captured anything. You need something like

Sub piccy()

ActiveSheet.Pictures.Insert ("C:\example\pic.jpg")

With ActiveSheet.Shapes(ActiveSheet.Shapes.Count)

.LockAspectRatio = False

.Top = Range("C3").Top

.Left = Range("C3").Left

.Height = Range("C3").RowHeight

.Width = Range("C3").Width

End With

End Sub

  BrendanKK 17 Feb 12

Vog, As always your a star.

Thank you. B

Advertisement

This thread is now locked and can not be replied to.

Should I upgrade to Windows 10? 8 reasons why you should upgrade to Windows 10... and 2 why you…

We are being sold the ability to spend money we don't have. And we love it

See 24 hours in London in 1 minute with Paul Richardson's hyperlapse film

How to use Apple Music in the UK: Complete guide to Apple Music's features

We use cookies to provide you with a better experience. If you continue to use this site, we'll assume you're happy with this. Alternatively, click here to find out how to manage these cookies

hide cookie message