0 votes
in VBA by Expert (848 points)

Hello everyone

It seems the question is simple but I couldn't figure it out,

I need to insert a picture without resizing the picture and the insertion would be at specific cell as start point.

What I have found is to insert picture 

With ActiveSheet.Pictures.Insert(sPath)
    .Left = 110
    .Top = 220
    .Width = 123
    .Height = 134
End With

But I don't want to change any property that's a point. Another one is to specify a cell to be the first cell for the inserted picture

1 Answer

+2 votes
by Skilled (466 points)
selected by
 
Best answer

Try this:

With ActiveSheet.Pictures.Insert(sPath)
    .Left = rCell.Left
    .Top = rCell.Top
    .Placement = xlMove
End With

where rCell is the first cell for the inserted picture.

Here is the XlPlacement Enum:
xlFreeFloating = 3, Object is free floating.
xlMove = 2, Object is moved with the cells.
xlMoveAndSize = 1, Object is moved and sized with the cells.

by Expert (848 points)
Thank you very much for this perfect solution ..

Simple and working well as expected

Welcome to wellsr Q&A
wellsr Q&A is the VBA and Python programming community that rewards you for learning how to code.

Getting Started
Register
VBA Cheat Sheets (On Sale Now)

Earn free prizes for asking VBA and Python questions and for answering questions asked by others in our community.

Looking for something else? Hire our professional VBA Help, instead.

What makes us different?
Our points system rewards you with a chance for free gifts based on the quality of your questions and answers. All you have to do is post and you could get rewarded, like these members:

ParserMonster $25 Amazon Gift Card
Hightree $10 Amazon Gift Card
Thales1 $10 Amazon Gift Card
runfunke $10 Amazon Gift Card
coolag $10 Amazon Gift Card
Siew Hun $10 Amazon Gift Card

So, why don't you join us? It really is an encouraging way to motivate members in our VBA and Python community.

Register

For more programming tips visit the VBA Tutorials Blog and the Python Tutorials Blog.

...