Need help with Split function in VB 6.0

Dim CMArray(),CMLine As String

'CMLine = "I,CM,S, ,90,1;I,CM,F, ,91,1"

CMArray = Split(CMLine,";")

This gives error Type missmatch.
I want to split CMLine with above containts(which keeps changing in size) to be split using ";".
Please help.

[257 byte] By [PrashantR.Sheelvant] at [2008-3-5]
# 1
The variable CMArray() must be declared as String.
Dim CMArray() As String.
In your code it is declared as Variant. That's all.
MarkusH at 2007-9-9 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...
# 2

As Markus H said, you must declare CMArray() as string.

The code is as follows

==============

Dim CMLine As String

Dim CMArray() As String

'CMLine = "I,CM,S, ,90,1;I,CM,F, ,91,1"

CMArray = Split(CMLine,";")

thanks Markus!
-brenda (ISV Buddy Team)

MSISVBuddyTeam at 2007-9-9 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...
# 3
Prashant

Dim CMArray(),CMLine As String

will not declare both CMArray() and CMLine As String

Only the CMLine is declared as a String

this is one of the 'easiest' bug I find in the code review and obviously the most repeadted too.

Shasur at 2007-9-9 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...