Falla macro al activar compartir
Buen día
Hola a todos, espero que alguien me pueda ayudar.
Tengo una rutina que funciona bien, pero cuando paso a compartir el libro no funciona, me muestra el error "no se puede asignar la propiedad top de la clase OLEObject"
Private Sub CheckBox1_Click()
ActiveWorkbook.UnprotectSharing
Dim pie As String
Dim LUG As String
Application.ScreenUpdating = False
If CheckBox1.Value = True Then
CheckBox1.Value = 0
f = ActiveCell.Row
A = Range("a1").Offset(f - 1, 10)
'Range("a").Offset(F - 1, 10).Select
Application.Run "'mesasaproduccion.xlsm'!PONERCODIGOS"
ActiveWorkbook.ProtectSharing
Exit Sub
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.COLUMN = 1 Then
OLEObjects(1).Top = Target.Top 'es el único por eso su indice es 1
OLEObjects(1).Object.Value = False 'desactiva la casilla al moverse
End If 'si se ocuparan mas debería cambiarse por su nombre "CheckBox1"
End Sub