forrest
12-06-2015, 04:29 PM
I am trying to write a function in MS Office Excel. I continue to get the following error message when I test the function:
Compile error: Expected: line number or label or state or end of statement.
I reduced the function code down to the bare minimum, but keep getting the error.
Here is the function code:
Function z() As Variant
Debug.Print 123
z = 99
End Function
I am testing the function in the immediate window within Excel VBA with the following line:
=z()
I would expect to see 123 displayed following the call to the function, instead I am getting the error message above. Any ideas? Could there be a permissions / setup problem?
Thanks!
PS using MS Office Standard 2013
Compile error: Expected: line number or label or state or end of statement.
I reduced the function code down to the bare minimum, but keep getting the error.
Here is the function code:
Function z() As Variant
Debug.Print 123
z = 99
End Function
I am testing the function in the immediate window within Excel VBA with the following line:
=z()
I would expect to see 123 displayed following the call to the function, instead I am getting the error message above. Any ideas? Could there be a permissions / setup problem?
Thanks!
PS using MS Office Standard 2013