Hey Guys,
Thanks for the replies, I really appreciate it.
But I still can't get this to work under your advisement. The problem is:
Joel: Recording the macro is a great suggestion but I'd already tried that
to no avail. It seems that the macro only captures the cell selection,
resizing and etc; not anything with regard to the picture insertion oddly
enough. Note: I am using Excel 2007. I did try this using Excel 2003 and it
does capture the insertion and resizing but I don't know how the code
translates to
VB.NET.
Selection.ShapeRange.ScaleWidth 1.59, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 1.59, msoFalse, msoScaleFromTopLeft
The Excel Selection Object has none of the methods that are generated and I
can't identify any of the constants either. (At least apparently not in Excel
2007)
Jim: Your code seems somewhat identical to the code I posted but taking your
reply to heart, I did change a few details to more closely mimic what you
posted. But the results were the same; Excel seems to ignore the programming
code.
Any other thoughts or suggestions? Could it be an issue that is specific to
the Excel 2007 programming library? I am truly at a lost.
Thanks guys.
"Jim Cone" wrote:
This should be close...
'--
oRng = osheet.Range("A1")
oRng.Select
osheet.Pictures.Insert (oexcel.StartupPath & "\logo.gif")
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)
"mindscape777"
wrote in message
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!