Simple Insert Picture question

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

If I record a macro, it looks like this:

ActiveSheet.Pictures.Insert("C:\Photos\3078.JPG").Select

Obviously, I want to make the "3078.JPG" a variable that
I create by selecting a cell from a list of many JPGs. I
tried:

AAA=Activecell.Value
ActiveSheet.Pictures.Insert("C:\Photos\" & AAA

I also tried ActiveSheet.Pictures.Insert
Filename="C:\Photos\" & AAA

Neither worked. I must be getting the syntax wrong.

TIA
paul
 
Paul,

Both of these work for me

AAA = ActiveCell.Value
ActiveSheet.Pictures.Insert Filename:="C:\Photos\" & AAA

AAA = ActiveCell.Value
ActiveSheet.Pictures.Insert "C:\Photos\" & AAA

Are you sure you are including the .jpg in the cell value?
 
Back
Top