Iniciar sesión con Microsoft
Iniciar sesión o crear una cuenta
Hola:
Seleccione una cuenta diferente.
Tiene varias cuentas
Elija la cuenta con la que desea iniciar sesión.

Última actualización: 10 de abril de 2019

PROBLEMA

En Excel para Mac, se introdujo un nuevo Editor de Visual Basic en octubre de 2017. Con este nuevo editor de VB, existe un problema con la creación de declaraciones de objeto mediante la selección en el menú desplegable en la parte superior de la ventana de código.

Si hace clic en la lista desplegable de la izquierda y elige un elemento de la lista, recibirá un código para el evento seleccionado en la lista desplegable a la derecha. Puede hacer las selecciones adicionales en la lista desplegable de la derecha para crear un código adicional para controlar el evento seleccionado.

Editor de VBE mostrando lista desplegable de selección de objeto

En su lugar, se produce el error de que no se crea el código.

Error de Microsoft Visual Basic: La variable usa un tipo de automatización no admitido en Visual Basic

ESTADO: SOLUCIÓN ALTERNATIVA

Elija una de estas soluciones alternativas para este problema:

SOLUCIÓN ALTERNATIVA #1

Puede realizar el paso similar en un equipo con Excel para Windows y, a continuación, copie el código en Excel para Mac.

SOLUCIÓN ALTERNATIVA #2

Puede ir a MSDN y buscar la sintaxis para el evento que desee usar y escribir el código manualmente en el proyecto VBA. Este artículo describe los eventos del libro de Microsoft Excel: Eventos del libro.

SOLUCIÓN ALTERNATIVA #3

Copie el código de evento de los siguientes ejemplos y péguelo al proyecto de VBA. Para cada evento, asegúrese de copiar de "Private Sub..." a "End Sub", ambos inclusive.

Private Sub Workbook_Activate()
End Sub

Private Sub Workbook_AddinInstall()
End Sub

Private Sub Workbook_AddinUninstall()
End Sub

Private Sub Workbook_AfterRemoteChange()
End Sub

Private Sub Workbook_AfterSave(ByVal Success As Boolean)
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
End Sub

Private Sub Workbook_BeforePrint(Cancel As Boolean)
End Sub

Private Sub Workbook_BeforeRemoteChange()
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
End Sub

Private Sub Workbook_Deactivate()
End Sub

Private Sub Workbook_NewChart(ByVal Ch As Chart)
End Sub

Private Sub Workbook_NewSheet(ByVal Sh As Object)
End Sub

Private Sub Workbook_Open()
End Sub

Private Sub Workbook_PivotTableCloseConnection(ByVal Target As PivotTable)
End Sub

Private Sub Workbook_PivotTableOpenConnection(ByVal Target As PivotTable)
End Sub

Private Sub Workbook_RowsetComplete(ByVal Description As String, ByVal Sheet As String, ByVal Success As Boolean)
End Sub

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
End Sub

Private Sub Workbook_SheetBeforeDelete(ByVal Sh As Object)
End Sub

Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
End Sub

Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
End Sub

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
End Sub

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
End Sub

Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
End Sub

Private Sub Workbook_SheetFollowHyperlink(ByVal Sh As Object, ByVal Target As Hyperlink)
End Sub

Private Sub Workbook_SheetPivotTableAfterValueChange(ByVal Sh As Object, ByVal TargetPivotTable As PivotTable, ByVal TargetRange As Range)
End Sub

Private Sub Workbook_SheetPivotTableBeforeAllocateChanges(ByVal Sh As Object, ByVal TargetPivotTable As PivotTable, ByVal ValueChangeStart As Long, ByVal ValueChangeEnd As Long, Cancel As Boolean)
End Sub

Private Sub Workbook_SheetPivotTableBeforeCommitChanges(ByVal Sh As Object, ByVal TargetPivotTable As PivotTable, ByVal ValueChangeStart As Long, ByVal ValueChangeEnd As Long, Cancel As Boolean)
End Sub

Private Sub Workbook_SheetPivotTableBeforeDiscardChanges(ByVal Sh As Object, ByVal TargetPivotTable As PivotTable, ByVal ValueChangeStart As Long, ByVal ValueChangeEnd As Long)
End Sub

Private Sub Workbook_SheetPivotTableChangeSync(ByVal Sh As Object, ByVal Target As PivotTable)
End Sub

Private Sub Workbook_SheetPivotTableUpdate(ByVal Sh As Object, ByVal Target As PivotTable)
End Sub

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
End Sub

Private Sub Workbook_SheetTableUpdate(ByVal Sh As Object, ByVal Target As TableObject)
End Sub

Private Sub Workbook_Sync(ByVal SyncEventType As Office.MsoSyncEventType)
End Sub

Private Sub Workbook_WindowActivate(ByVal Wn As Window)
End Sub

Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
End Sub

Private Sub Workbook_WindowResize(ByVal Wn As Window)
End Sub

Private Sub Worksheet_Activate()

End Sub

Private Sub Worksheet_BeforeDelete()

End Sub

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

End Sub

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)

End Sub

Private Sub Worksheet_Calculate()

End Sub

Private Sub Worksheet_Change(ByVal Target As Range)

End Sub

Private Sub Worksheet_Deactivate()

End Sub

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

End Sub

Private Sub Worksheet_LensGalleryRenderComplete()

End Sub

Private Sub Worksheet_PivotTableAfterValueChange(ByVal TargetPivotTable As PivotTable, ByVal TargetRange As Range)

End Sub

Private Sub Worksheet_PivotTableBeforeAllocateChanges(ByVal TargetPivotTable As PivotTable, ByVal ValueChangeStart As Long, ByVal ValueChangeEnd As Long, Cancel As Boolean)

End Sub

Private Sub Worksheet_PivotTableBeforeCommitChanges(ByVal TargetPivotTable As PivotTable, ByVal ValueChangeStart As Long, ByVal ValueChangeEnd As Long, Cancel As Boolean)

End Sub

Private Sub Worksheet_PivotTableBeforeDiscardChanges(ByVal TargetPivotTable As PivotTable, ByVal ValueChangeStart As Long, ByVal ValueChangeEnd As Long)

End Sub

Private Sub Worksheet_PivotTableChangeSync(ByVal Target As PivotTable)

End Sub

Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)

End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub

Private Sub Worksheet_TableUpdate(ByVal Target As TableObject)

End Sub

Más recursos

Icono de expertos (cerebro, engranajes)

Preguntar a los expertos

Lea nuestro blog y conecte con expertos, comente las novedades, las actualizaciones y los procedimientos recomendados más recientes para Excel.

Excel Tech Community

Icono de comunidad

Obtener ayuda de la comunidad

Formule una pregunta y encuentre soluciones facilitadas por agentes de soporte técnico, MVP, ingenieros y otros usuarios de Excel.

Foro de Excel sobre respuestas

Icono de solicitud de característica (bombilla, idea)

Sugerir una característica nueva

Estaremos encantados de escuchar sus sugerencias y comentarios. Comparta sus ideas. Su opinión nos importa.

Enviar comentarios

Vea también

Correcciones o soluciones alternativas para problemas recientes en Excel para Mac

¿Necesita más ayuda?

¿Quiere más opciones?

Explore las ventajas de las suscripciones, examine los cursos de aprendizaje, aprenda a proteger su dispositivo y mucho más.

Las comunidades le ayudan a formular y responder preguntas, enviar comentarios y leer a expertos con conocimientos extensos.

Encuentre soluciones a problemas comunes u obtenga ayuda de un agente de soporte técnico.

¿Le ha sido útil esta información?

¿Cuál es tu grado de satisfacción con la calidad del lenguaje?
¿Qué ha afectado a su experiencia?
Si presiona Enviar, sus comentarios se usarán para mejorar los productos y servicios de Microsoft. El administrador de TI podrá recopilar estos datos. Declaración de privacidad.

¡Gracias por sus comentarios!

×