|
私の環境は
Windows XP pro 5.1.2600 SP3
Excel 2003 (11.8316.8221) SP2 (Office Personal)
Excel 2000 (9.0.8968) SP3
VBA Retail 6.5.1040
ですが、現象が確認できません。
そちらの環境はどうですか?
取り敢えず、少しコードを整理して様子を見てください。
'ThisWorkbookModule
Option Explicit
'---------------------------------------------------------------------
Private Sub workbook_open()
Me.Sheets("タグ").Visible = xlSheetVeryHidden
Me.Sheets("台帳").Protect
End Sub
'---------------------------------------------------------------------
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Me.Sheets("タグ").Visible = xlSheetVeryHidden
With Me.Sheets("台帳")
.AutoFilterMode = False
.Protect
End With
If Me.Saved = False Then Me.Save
End Sub
'---------------------------------------------------------------------
Private Sub Workbook_WindowActivate(ByVal Wn As Window)
barSet
End Sub
'---------------------------------------------------------------------
Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
barReset
End Sub
'---------------------------------------------------------------------
Private Sub barSet()
On Error Resume Next
With Application
.ScreenUpdating = False '■
.CommandBars("Worksheet Menu Bar").Enabled = False 'メニューバーOFF
.CommandBars("standard").Visible = False '標準OFF
.CommandBars("picture").Visible = False '図ON
.CommandBars("drawing").Visible = False '図形描画OFF
.CommandBars("formatting").Visible = False '書式設定OFF
.DisplayFormulaBar = False
.DisplayStatusBar = False
.ScreenUpdating = True
End With
End Sub
'---------------------------------------------------------------------
Private Sub barReset()
On Error Resume Next
With Application
.ScreenUpdating = False
.CommandBars("Worksheet Menu Bar").Enabled = True 'メニューバーON
.CommandBars("standard").Visible = True '標準ON
.CommandBars("picture").Visible = True '図ON
.CommandBars("drawing").Visible = True '図形描画ON
.CommandBars("formatting").Visible = True '書式設定ON
'.OnTime Now, Me.CodeName & ".test"
.DisplayFormulaBar = True
.DisplayStatusBar = True
.ScreenUpdating = True
End With
End Sub
上記コードでも出るようでしたら Private Sub barSet() の
■のScreenUpdating制御をコメントアウトしてください。
でも、元々"standard","picture","drawing","formatting" 『以外』のバーを表示させていたら
>各ツールバーの表示やユーザー設定が出来てしまい...
という状況は発生します。
|
|