R
ragtopcaddy via AccessMonster.com
Here's my code:
On Error Resume Next
rs.Close
Set rs = Nothing
wkBk.Close
Set wkBk = Nothing
xlObj.Quit
Set xlObj = Nothing
End Function
Most of the time, the workbook will be closed. My intention is that, if the
wkbk is already closed and/or set to nothing, the next line of code should
execute. It doesn't. Instead I get Run-time error '91' - "Object variable or
With block variable not set" and the code stops at "wkBk.Close". Where am I
going wrong?
On Error Resume Next
rs.Close
Set rs = Nothing
wkBk.Close
Set wkBk = Nothing
xlObj.Quit
Set xlObj = Nothing
End Function
Most of the time, the workbook will be closed. My intention is that, if the
wkbk is already closed and/or set to nothing, the next line of code should
execute. It doesn't. Instead I get Run-time error '91' - "Object variable or
With block variable not set" and the code stops at "wkBk.Close". Where am I
going wrong?