View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel[_150_] joel[_150_] is offline
external usenet poster
 
Posts: 1
Default VB.NET Inserted Picture Ends Up in Wrong Cell


I don't know VB Net but I will try to answer your question. The inser
picture method you can't specify the location. You have to insert th
picture then move it using the picture propertie
.left,.width,.top,.height.

The .left,.top,.top., height are pixel locations that are equivalen
for pictures (shapes) and cells. shapes are not part of the cel
structure and actually sit ontop of the worksheet (not in the sheet).

My VB Net coe may not work. Make changes as required

from
objSheet.Pictures.insert("e:\temp\jpeg samples\s_01.jpg")
to
set obj = objSheet.Pictures.insert("e:\temp\jpeg samples\s_01.jpg")
obj.left = range("B4").left
obj.width = range("B4").width
obj.top = range("B4").top
obj.height = range("B4").heigh

--
joe
-----------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=22
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=14984