Collabora Office 21.06 ヘルプ
プログラムコード中で使用するすべての変数を、Dim ステートメントを使って明示的に宣言する必要があるようにします。
Option Explicit
Option Explicit
Sub ExampleExplicit
Dim sVar As String
sVar = "Las Vegas"
For i% = 1 to 10 REM これは実行時エラーとなります
Rem
Next i%
End Sub