2017-06-02 125 views
0

當在屏幕下方運行代碼時,屏幕閃爍得很厲害。這似乎只發生在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 

重要的是要注意,該例程是由我的主頁上的按鈕執行的。在打開之後的第一次執行期間發生閃爍。如果我在沒有關閉之後點擊按鈕,那麼就沒有閃爍。

回答

0

我已經解決了我的功能移動到已啓動它的子結束的問題。它現在是End Sub之前執行的最後一個函數。根本不再有閃爍。

0

我曾與在辦公室2016屏幕的問題類似的問題,我解決它通過禁用硬件加速:

要禁用硬件加速,請按照下列步驟操作: 啓動任何Office程序。 On

  • 在文件選項卡上,單擊選項。
  • 在選項對話框中,單擊高級。
  • 在可用選項列表中,單擊以選中禁用硬件圖形加速複選框。 ...
  • 單擊確定。

這是從MSDN:

https://support.microsoft.com/en-gb/help/2768648/display-issues-in-office-client-applications

+0

謝謝。剛剛嘗試過,但沒有任何區別。 –