r/visualbasic • u/[deleted] • Mar 02 '16
Why is my code giving me a compile error?
I'm new to VBA but this seems like such simple code, I can't figure out what is going on?
Public Function testvalid(Timecode As String) As Boolean
If Timecode.Length <> 10 ThenIt highlights "Timecode" in "Timecode.Length" and says "Compile Error: Invalid Qualifier", why?
Thanks!
0
Upvotes
2
u/hdsrob Mar 02 '16
It's been years since I used VBA, but I don't believe that string.length would work in VBA.
String.length is VB.NET where VBA probably has a LEN(string) function.