Excel insert picture shortcut

  Picklefactory 15:13 03 Dec 2007

We've just had Office 2007 rolled out across our company, and now my trusty signature macro (As explained in click here) is gone. Or was. I tried to do the same thing in Excel 2007 as I had done in '97, but the macro recorder would not pick up the 'Insert picture' steps. I started new macro, entered name/info etc and went through the insert picture moves from the ribbon, but when I stopped macro recorder, and looked at the code for macro, all that was there was start, info that I'd added and end, nothing in between. Luckily I still have '97 on my pc, so did it again in that, to check I'm not mental, and all worked fine, tried again in 2007, and it doesn't grab the insert picture steps. I've worked around it by copying the code across from '97 VBE into my 2007 macro, so my macro is now working OK in 2007, but I'd like to know how it should be done in 2007, as eventually, we will have '97 uninstalled. Any ideas?

  VoG II 15:58 03 Dec 2007

This what I got in Excel 2000

Sub Macro1()
ActiveSheet.Pictures.Insert ("C:\Documents and Settings\My Name\My Documents\12891-0\CPP\sig.jpg")
End Sub

I'll see what happens in Excel 2007 when I get home...

  Picklefactory 18:36 03 Dec 2007

The code I have works fine, I copied across the code from '97 into the VBA window in 2007, and works perfectly. My problem is how to create a new macro using the macro recorder in 2007. It just seemed to ignore me selecting Insert>picture>etc, it didn't seem to 'see' me clicking on those controls. I can happily make macro's on 97 and copy the code across to 07, at the moment, but we will, at some point, remove 97 from our machines. I hope that's a clearer explanation, I know what I mean, but don't always explain very well.

  Chris the Ancient 18:43 03 Dec 2007

... that might work.

Rather than record the macro using mouse clicks, try and do it with keyboard actions using the <alt> key to call up menu items?

  Picklefactory 19:04 03 Dec 2007

Aaah, never thought of that. Am at home now, but I'll give that a go tomorrow at work. (If I can remember the keyboard route, not done it for years, but I'll get there)

  VoG II 19:11 03 Dec 2007

Tried that - it is rather different in XL2007, you have to hold down ALT then a series of letters is displated on the ribbon (such as N for Insert - go figure!). Anyway, even doing it that way I get

Sub Macro1()
' Macro1 Macro

End Sub

I'm going to ask in another place...

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

Elsewhere on IDG sites

Alienware 17 R4 2017 review

Is this the future of VR and AR?

Best iPad buying guide 2017

Comment regarder le Bureau des L├ęgendes en ligne ?