Hello,
I have found this breaks the runtime
The
is ignored if the variable is not set.
Looking in the locals window, wb says <No Variables>.
How do I test this variable?
I can easily make the code
But I would like to know how to test the variable if not set.
I have found this breaks the runtime
VBA Code:
Dim wb As Workbook
If Not wb Is Nothing Then
On Error Resume Next
wb.Saved = True
wb.Close
On Error GoTo 0
End If
The
VBA Code:
If Not wb Is Nothing Then
Looking in the locals window, wb says <No Variables>.
How do I test this variable?
I can easily make the code
VBA Code:
Dim wb As Workbook
set wb = Nothing
If Not wb Is Nothing Then
wb.Saved = True
wb.Close
End If
But I would like to know how to test the variable if not set.