View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
mindscape777 mindscape777 is offline
external usenet poster
 
Posts: 4
Default Positioning Pictures in a Worksheet

Hi Joel.

Please see reply to Jim Cone.

Thanks.

"Joel" wrote:

You have to move the picture after it is placed on the worksheet. And Scale
the size of the picture. There a 4 parameters that need to be adjusted.
Top, Left, Width, and Height.

The best way of gettiing the code is to record a macro as you postition and
scale the part. Then use the recorded code.

Tools - Macro - Record Macro.

Then stop recording when done.

"mindscape777" wrote:

Hi.

I am generating Excel reports for my company using VB.NET programming but
have a problem when inserting an image into the spreadsheet and attempting to
position it within the sheet.

Please see my code snippet:

'Specify cell range for logo and insert the image
oRng = osheet.Range("A1")
oRng.Cells.Select()

oexcel.ActiveSheet.Pictures.Insert(Application.Sta rtupPath &
"\logo.gif").select()

oRng is my Excel.Range object. As you can see, I am trying to select the 1st
cell in the spreadsheet to position my picture but instead I just keep
getting it positioned where it wants to put it with the empty cell being
selected. (Not what I really want)

Is anyone here familiar with Excel programming in VB.NET that could advise
me of a solution or point me in the right direction if I'm in the wrong
place???

I would REALLY appreciate the help!