The code below should work (this is line by line translation from VBA). Unfortunately I cant test it because Im getting problem with MS Excel Interop.Excel.dll
Dim xapp As Excel.Application
Dim wbk As Excel.Workbook
Dim wks As Excel.Worksheet
Dim rng As Excel.Range
Dim pic As Object Excel.Picture
Dim strPictureFillPath As String
xapp = New Excel.Application()
xapp = CreateObject("Excel.Application.9")
dont forget to create test workboomk and save it in c:\temp\book1.xls
wbk = xapp.Workbooks.Open("c:\temp\book1.xls")
wks = xapp.Worksheets(1)
rng = wks.Cells(3, 3) Lets put the picture in the cell(3,3)
rng.Select()
this is a sample picture
strPictureFillPath = "C:\Documents and Settings\Administrator\My Documents\My Pictures\Sample.jpg"
wks.Pictures.Insert(strPictureFillPath).Select()
pic = xapp.Selection
With pic
.Name = "My Picture"
.Left = rng.Left
.Top = rng.Top
.Width = rng.Width
.Height = rng.Height
.Placement = 1 xlMoveAndSize
.PrintObject = True
.Locked = True
End With
wbk.Save()
xapp.Quit()
xapp = Nothing
HTH,
Shamil