An expected part of the syntax was not found. The error is usually located to the left of the selected item, but isn't always obvious. For example, you can invoke a Sub procedure with or without the Call keyword. However, if you use the Call keyword, you must enclose the argument list in parentheses. This error has the following causes and solutions:
X = Workbook.Add F:= 5 ' Error due to no parentheses.
Call MySub 5 ' Error due to no parentheses.
Use parentheses in a function call that specifies arguments or with a Sub procedure invocation that uses the Call keyword.
Workbook.Add (X:=5, Y:=7) ' Function call without expression.
YourSub(5, 7) ' Sub invocation without Call.
Always use function calls in expressions. If you have multiple arguments enclosed in parentheses in a Sub procedure call, you must use the Call keyword.
Workbook.Add (X:= ) ' Error because no value assigned to
' named argument.
Either add a value for the argument, or delete the argument if it's optional.
Input # 1, Type ' Type keyword invalidly used as
' variable name.
Rename the variable so it doesn't conflict with restricted keywords.
For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).