在我的情况下,使用OR无效,我必须使用AND,而且我不确定为什么。
Sub blah()
If LCase(Environ("username")) <> "me" Or LCase(Environ("username")) <> "some other user" Then '''DOESN'T WORK
Stop
ElseIf LCase(Environ("username")) <> "me" And LCase(Environ("username")) <> "some other user" Then '''WORKS
Stop
End If
End Sub
Run Code Online (Sandbox Code Playgroud)