RalphOrtiz
asked on
Inserting image file into Excel cell using VB6
I having problems placing a image file into excel 2007 cell. I using the same routine which works well with excel 2003 and below. When I place the image in Excel 2007 the image is place in the center of the cell which requires the end user to manually move the image to the upper right hand corner of cell A1.
sample code.
oXLApp.Range("A1").Select
oXLApp.Range("A1").RowHeig ht = 59.25
oXLApp.Range("A1").Select
Delay 3
oXLApp.ActiveSheet.Picture s.Insert(" C:\asl.gif ").Select
sample code.
oXLApp.Range("A1").Select
oXLApp.Range("A1").RowHeig
oXLApp.Range("A1").Select
Delay 3
oXLApp.ActiveSheet.Picture
ASKER
To TheLearnedOnel, thanks well appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I can not remember where I got this code but I may help you. Let me know?
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
Next oPic
End With
End Sub
Lookup-Pic-example.xls
Oh and I would like to have what code you have, I am having the opposite problem I have 2007 and want my pix to center lol.
ASKER
I used this code to insert an image into Excel 2007. The following places the image and adjust
oXLApp.Selection.ShapeRang e.Top = ce.Top
oXLApp.Selection.ShapeRang e.Left = ce.Left
oXLApp.Selection.ShapeRang
oXLApp.Selection.ShapeRang
ASKER
oXLApp.Range("A1").Select
oXLApp.Range("A1").RowHeig
Delay 1
Set ce = oXLApp.Range("A1", oXLApp.Cells(oXLApp.Rows.C
oXLApp.ActiveSheet.Picture
oXLApp.Selection.ShapeRang
oXLApp.Selection.ShapeRang