I have a subroutine that takes a string and an integer. I was getting an incredibly vague error message (given the number of years and billionaires involved with Microsoft) when I tried to call it. It said: "Syntax error" and highlighted the line in red. Occasionally, if it was in the mood, it would say that it was looking for an "=" sign. A big thanks to the "highlight but don't clarify" coding team. Anyway, it turns out that VBA did not like parentheses around the arguments as in
MySub("hello", 1)
instead I had to do
MySub "hello", 1
I was able to use the parentheses if I defined the subroutine with only a single string argument.
What are the rules for using parentheses with subroutine calls?
MySub("hello", 1)
instead I had to do
MySub "hello", 1
I was able to use the parentheses if I defined the subroutine with only a single string argument.
What are the rules for using parentheses with subroutine calls?