Como puedo ejecutar Private Sub Worksheet_Change(ByVal Target As Range) con la hoja de excel protegida
Desarrollador de excel
La hoja de excel cuando no esta protegida contra cambios se ejecuta pero cuando se protege la hoja no se activa la tarea
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Target.Cells = Range("I2") Then
foto = Range("H2").Value
Application.ScreenUpdating = False
foto = foto & ".jpg"
ruta = ActiveWorkbook.Path & "\fotos\" & foto
Me.Shapes("foto_del").Delete
Set fotografia = Me.Pictures.Insert(ruta)
With Range("B1")
Arriba = .Top
Izquierda = .Left
Ancho = .Offset(0, .Columns.Count).Left - .Left
Alto = .Offset(.Rows.Count, 0).Top - .Top
End With
With fotografia
.Name = "foto_del"
.Top = Arriba
.Left = Izquierda
.Width = Ancho
.Height = Alto
End With
Set fotografia = Nothing
Application.ScreenUpdating = True
End If
End Sub