Falla en macro de insertar imagen
Sub CenterPicture()
Application.ScreenUpdating = False
Dim imag As Object
Dim celda As Range
Dim path As Variant
Dim fila As Integer
fila = 5
While Sheets("hoja2").Cells(fila, 5) <> Empty
path = Application.GetOpenFilename("archivos JPG PNG BMP (*.jpg*;*.png*;*.bmp*), *.jpg*;*.png*;*.bmp*")
Cells(fila, 5).Activate
Set ran = ActiveCell
Set imag = Sheets("hoja2").Pictures.Insert(path)
cv = 70
rh = 150
With imag
.Top = ran.Top
.Width = cv
.Height = rh
.Left = ran.Left
End With
ActiveCell.RowHeight = imag.Height
ActiveCell.ColumnWidth = 39.5
fila = fila + 1
Wend
Set imag = Nothing
Set ran = Nothing
End Sub
Me dice error 9 en tiempo de ejecucion
1 Respuesta
Respuesta de Elsa Matilde
2