Macro para insertar fotos en Excel y que se queden fijas
He creado la siguiente macro para que me inserte fotos desde una carpeta a un Excel en función de un valor de la celda y hasta ahí funciona bien pero quiero que una vez insertadas se peguen como imagen en el Excel para que no esté "recalculando" el vinculo constantemente y no de error a las personas que no tengan acceso a la ruta. La idea es agregar a la macro una línea para que una vez insertado las imágenes al reporte, te seleccione todas las imágenes corte y pegue con formato de imagen. Lo he intentado con la la grabadora de macros sin mucho éxito.. ¿Cómo lo podría solucionar sobre este ejemplo?
Muchas gracias!
Sub FicherosCarpeta()
Dim Ruta As String
Dim fotos As Object
Dim rng As Range, celda As Range
On Error Resume Next
Application.ScreenUpdating = False
Dim img As Shape
On Error Resume Next
For Each img In ActiveSheet.Shapes
If img.Type = 11 Then img.Delete
Next
Ruta = "O:\05-compras\04-ventas\61\FOTOS 61\reducidas\"
Set Carpeta = fso.GetFolder("O:\05-compras\04-ventas\61\FOTOS 61\reducidas\")
Set ficheros = Carpeta.Files
Set rng = Worksheets("acc").Range("d4:d43")
For Each celda In rng
If Len(Trim(celda)) > 0 Then
Set r1 = Cells(celda.Row, "C")
r1.Select
Set fotos = ActiveSheet.Pictures.Insert("O:\05-compras\04-ventas\61\FOTOS 61\reducidas\" & celda.Value & ".JPG").Select
Selection.ShapeRange.LockAspectRatio = False
Selection.ShapeRange.Height = r1.Height - 15
Selection.ShapeRange.Width = r1.Width - 30
Selection.ShapeRange.Left = r1.Left + 6
Selection.ShapeRange.Top = r1.Top + 6
' insertar fotos en celda
ActiveSheet.DrawingObjects.Select
Selection.Placement = xlMoveAndSize
End If
Next celda
Set fso = Nothing
Set Carpeta = Nothing
Set ficheros = Nothing
Set rng = Nothing
Set r1 = Nothing
Set fotos = Nothing
Application.ScreenUpdating = True
End Sub