user3575705
user3575705

Reputation: 1

Use of Try...Catch in Visual Basic in Excel 2011 for Mac

I would like to use Try...Catch blocks in some Visual Basic macros for Excel 2011 on a Mac instead of On Error. However, it does not seem to recognize those terms. Is this method of handling exceptions not available on Macs?

Upvotes: 0

Views: 10290

Answers (1)

The Blue Dog
The Blue Dog

Reputation: 2475

It's not a Mac thing, there is no Try/Catch in VBA. The closest you will get is:

Sub Test() 
    On Error Goto Err 

    ' This is your 'Try'

    Exit Sub

Err: 
    ' This is your 'Catch'
End Sub

Upvotes: 10

Related Questions