|
おはようございます。
>Application.ScreenUpdating = False
これをどこで使うかは、プログラムの構造や汎用性などを
考えると結構難しいですねえ!!
一例ですが、
新規ブックの標準モジュールに
'=======================================================
Sub main()
Dim bk As Workbook
Application.ScreenUpdating = False
Set bk = bk_open(False)
Application.ScreenUpdating = True
End Sub
'=======================================================
Function bk_open(Optional ByVal vsbl As Boolean = True) As Workbook
Dim flnm As Variant
Dim bkw As Window
flnm = Application.GetOpenFilename
Set bk_open = Nothing
If TypeName(flnm) <> "Boolean" Then
On Error Resume Next
Set bk_open = Workbooks.Open(flnm)
If Err.Number <> 0 Then
MsgBox Err.Description
Else
If vsbl = False Then
For Each bkw In bk_open.Windows
bkw.visible = False
Next
End If
End If
on error goto 0
End If
End Function
検討してみてください。
|
|