A
Andrew.Kirkham
Hi,
In Excel XP the following code generates the error:
Compile Error - Expected Array
Enum ColourID
Rose = 38
Lavender = 39
Tan = 40
LightBlue = 41
End Enum
Sub Test()
Dim dblRes As Double
dblRes = Tan(1#)
MsgBox dblRes
End Sub
If I remove the Tan colour ID from the enum it works as expected.
Presumably Excel is seeing Tan in sub Test and matching it to
ColourID.Tan and not the Tan function.
So how do I get Excel to use the Tan function in this case?
[Interestingly, you cannot put a lower case 't' on tan in the enum -
VBA changes it to 'Tan']
In Excel XP the following code generates the error:
Compile Error - Expected Array
Enum ColourID
Rose = 38
Lavender = 39
Tan = 40
LightBlue = 41
End Enum
Sub Test()
Dim dblRes As Double
dblRes = Tan(1#)
MsgBox dblRes
End Sub
If I remove the Tan colour ID from the enum it works as expected.
Presumably Excel is seeing Tan in sub Test and matching it to
ColourID.Tan and not the Tan function.
So how do I get Excel to use the Tan function in this case?
[Interestingly, you cannot put a lower case 't' on tan in the enum -
VBA changes it to 'Tan']