Home » VB.NetRSS

Excel 2003 + VBA + Insert Picture issue

Hi,

I am using Excel 2003. I am doing VBA code development to format the excel sheets.

While trying to insert a picture in a cell usng the code

Range("A1").select

ActiveSheet.Pictures.Insert("C:\data\logo.jpg").select

I am receiving an error "Unable to get the insert property of the pictures class". Run time error 1004. Can anyone please help me to resolve this issue?

 

Thanks,

Sivakumar IRIAD

 

2 Answers Found

 

Answer 1

Everything is fine with your code, but is that the correct path and filename?

I used the same code you have posted above (but changed the filepath to an image on my machine) and it worked great.

But then I changed a letter in the path and I received the same error you mention above. If the file/path does not exist, it will throw that error.

 

 

Answer 2

The issue  i mentioned above has been resolved. Actually i don't have admin right in my PC. I tested the same code in some other PC. It is working fine without any error.

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter