1
0

More than 5 years have passed since last update.

Excel2007 終了処理 VBA

Last updated at Posted at 2012-02-27

VBAから終了させます。

1行目は、他のシートが開いていた場合は
Bookを終了しますが、Excelは終了しません。

2行目は、他のシートが開いていない場合です。
Excelと共に終了します。
ただし、変更があってもなくても問合せのダイアログボックスを
表示しないオプションがついていますので、変更する可能性がある場合は、
SaveChanges:=True(省略可)として下さい。

終了処理
private Sub exitThisExcel()
    If Workbooks.count <= 1 Then Application.Quit
    ThisWorkbook.Close SaveChanges:=False
End Sub
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0