Jenny Wang
Jenny Wang

Reputation: 11

VBA Userform not outputting runtime errors

I have a userform that opens several files and processes them. But I just realized the program doesn't stop or output any runtime errors when there is one. For example,

Dim wb as workbook
Dim ws as worksheet

set ws = wb.sheets("Random")

Even if there's no sheet in the workbook named "Random", the above code won't stop and tell me there's a runtime error. How can I fix it?

Thanks!

Upvotes: 1

Views: 41

Answers (1)

Bernard Saucier
Bernard Saucier

Reputation: 2260

Try adding On Error GoTo 0.

It will turn error displaying back on.

Upvotes: 0

Related Questions