當在屏幕下方運行代碼時,屏幕閃爍得很厲害。這似乎只發生在Office 2016中。在Office 2010和Office 2016的Mac中,根本沒有閃爍。任何人都可以引導我?Office 2016中的屏幕閃爍運行宏
我已經嘗試過很多變化,但沒有任何東西似乎擺脫了閃爍。我甚至用更新false和true的方式將這個調用包裝到了這個子類中,但沒有運氣。
Public Sub applyLogosToDashboard()
Application.ScreenUpdating = False
If Not Application.OperatingSystem Like "*Mac*" Then
Sheets("Dashboard").Activate
Sheets("Dashboard").Unprotect Password:=Sheets("Logos").Range("IV1")
ActiveSheet.Shapes("Apple_Logo").Visible = False
ActiveSheet.Shapes("Win_Logo").Visible = True
ActiveSheet.Shapes("Button_Insert_Logo").Visible = True
ActiveSheet.Shapes("Button_Print_PDF").Visible = True
ActiveSheet.Shapes("Button_Save_As").Visible = True
ActiveSheet.Shapes("Button_Help").Visible = True
ActiveSheet.Shapes("Button_Versions").Visible = True
Sheets("Logos").Protect Password:=Sheets("Dashboard").Range("IV1"), DrawingObjects:=True, Contents:=True, Scenarios:=True
Else
Sheets("Dashboard").Activate
Sheets("Dashboard").Unprotect Password:=Sheets("Dashboard").Range("IV1")
ActiveSheet.Shapes("Apple_Logo").Visible = True
ActiveSheet.Shapes("Win_Logo").Visible = False
ActiveSheet.Shapes("Button_Insert_Logo").Visible = False
ActiveSheet.Shapes("Button_Print_PDF").Visible = False
ActiveSheet.Shapes("Button_Save_As").Visible = False
Sheets("Dashboard").Protect Password:=Sheets("Dashboard").Range("IV1"), DrawingObjects:=True, Contents:=True, Scenarios:=True
End If
Application.ScreenUpdating = True
End Sub
重要的是要注意,該例程是由我的主頁上的按鈕執行的。在打開之後的第一次執行期間發生閃爍。如果我在沒有關閉之後點擊按鈕,那麼就沒有閃爍。
謝謝。剛剛嘗試過,但沒有任何區別。 –