Iniciar sessão com a Microsoft
Iniciar sessão ou criar uma conta.
Olá,
Selecione uma conta diferente.
Tem várias contas
Selecione a conta com a qual pretende iniciar sessão.

Última Atualização: 10 de Abril de 2019

PROBLEMA

No Excel para Mac, foi introduzido um novo Visual Basic Editor em outubro de 2017. Neste novo Visual Basic Editor, existe um problema ao criar declarações de objetos através do menu pendente na parte superior da janela de código.

Se clicar no menu pendente à esquerda e selecionar um item na lista, deverá obter um código referente ao evento selecionado na lista pendente à direita. Pode fazer mais seleções na lista pendente à direita para criar código adicional para processar o evento selecionado.

O Visual Basic Editor a mostrar a lista pendente da seleção de objetos

Contudo, ocorre um erro e o código não é criado.

Erro do Microsoft Visual Basic Editor: A variável utiliza um tipo de automatização que não é suportado no Visual Basic.

ESTADO: SOLUÇÃO

Selecione uma destas soluções temporárias para o problema:

SOLUÇÃO N.º 1

Pode efetuar um passo semelhante num computador a executar o Excel para Windows e, em seguida, copiar o código para o Excel para Mac.

SOLUÇÃO N.º 2

Pode aceder ao MSDN e localizar a sintaxe do evento que pretende utilizar e escrever o código manualmente no seu projeto do VBA. Este artigo descreve os eventos de livros do Microsoft Excel – Eventos de Livros.

SOLUÇÃO N.º 3

Copie o código do evento adequado a partir dos exemplos abaixo e cole-o no seu projeto do VBA. Para cada evento, certifique-se de que copia de "Private Sub..." a "End Sub", 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

Mais Recursos

Ícone Especialistas (cérebro, roda dentada)

Perguntar aos especialistas

Fale com especialistas, discuta as novidades mais recentes, atualizações e práticas recomendadas do Excel e leia o nosso blogue.

Excel Tech Community (Comunidade Tecnológica do Excel)

Ícone Comunidade

Obter ajuda na comunidade

Faça uma pergunta e encontre soluções com a ajuda dos Agentes de Suporte, MVPs, Engenheiros e outros utilizadores do Excel.

Fórum do Excel no Answers

Ícone de pedido de funcionalidade (lâmpada, ideia)

Sugerir uma nova funcionalidade

Adoramos ler as suas sugestões e o seu feedback! Partilhe as suas ideias. Estamos atentos ao seu feedback.

Fornecer feedback

Consulte também

Correções ou soluções para problemas recentes no Excel para Mac

Precisa de mais ajuda?

Quer mais opções?

Explore os benefícios da subscrição, navegue em cursos de formação, saiba como proteger o seu dispositivo e muito mais.

As comunidades ajudam-no a colocar e a responder perguntas, a dar feedback e a ouvir especialistas com conhecimentos abrangentes.

Encontre soluções para problemas comuns ou obtenha ajuda de um agente de suporte.

Estas informações foram úteis?

Quão satisfeito está com a qualidade do idioma?
O que afetou a sua experiência?
Ao selecionar submeter, o seu feedback será utilizado para melhorar os produtos e serviços da Microsoft. O seu administrador de TI poderá recolher estes dados. Declaração de Privacidade.

Obrigado pelo seu feedback!

×