Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
Por pinheirosth
Posts
#43434
Execultando o código abaixo me retorno o seguinte erro quando alterno entre uma planilha e outra ( nova ou já existente)

"Erro em tempo de execução 1004"

E ao depurar a seta amarela fica na linha " Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)" "


Informação Adicional: coloquei na "Esta pasta de Trabalho" o código

Private Sub Workbook_Deactivate()
Call TelaNormal
End Sub

Private Sub Workbook_Activate()
Call TelaCheia
End Sub


Private Sub Workbook_Open()
Call TelaCheia
End Sub

Private Sub Workbook_Close()
Call TelaNormal
End Sub
====================================================

Sub TelaCheia()


With Application

Application.ScreenUpdating = False
Application.EnableEvents = False

Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"
Application.DisplayFormulaBar = False
Application.DisplayStatusBar = False
Application.Caption = "HR Reports"

With ActiveWindow
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
.DisplayWorkbookTabs = False
.DisplayHeadings = False
.DisplayGridlines = False
End With

Application.ScreenUpdating = True
Application.EnableEvents = True

End With

End Sub
++++++++++++++++++++++++++++++++++++++++++++++++++++
Sub TelaNormal()

With Application

Application.ScreenUpdating = False
Application.EnableEvents = False

Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",True)"
Application.DisplayFormulaBar = True
Application.DisplayStatusBar = True
Application.Caption = ""

With ActiveWindow
.DisplayHorizontalScrollBar = True
.DisplayVerticalScrollBar = True
.DisplayWorkbookTabs = True
.DisplayHeadings = True
.DisplayGridlines = True
End With

Application.ScreenUpdating = True
Application.EnableEvents = True

End With

End Sub
Por babdallas
#43577
Tente usar este código:
Código: Selecionar todos
CommandBars.ExecuteMso "HideRibbon"
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord