指定必须使用 Dim 语句显式声明程序代码中的每个变量。
Option Explicit
Sub ExampleExplicit
Dim sVar As String
sVar = "Las Vegas"
For i% = 1 to 10 REM This results in a run-time error
REM
Next i%
End Sub