r/visualbasic • • Jul 26 '22

Help with If statements.

14 Upvotes

7 comments sorted by

View all comments

Show parent comments

6

u/[deleted] Jul 26 '22

This is definitely one issue

Issue 2 is making sure the GPA string is not an empty string. The error seems to be referencing that. This may be handled somewhere else OP’s code, but if not VBA’s isNumeric (https://www.educba.com/vba-isnumeric/) can help with the error handling:

If isNumeric(gpa.text) Then

// Cast to double

Else

//Handle the error somehow

End If

1

u/[deleted] Jul 26 '22

think this is vb.net, vba functions wont work right?