Для следующего кода Excel сообщает «Ungültiger Bezeichner» (неверный идентификатор).Строка, на которую он жалуется, - Select Case parts.Length
.Это жалуется на parts
.Есть идеи?
Public Sub parseFileName(fName As String, ByRef art As String, ByRef objnr As String, ByRef phase As String, ByRef index As String, ByRef text As String, ByRef warning As Boolean)
Dim parts() As String
parts = Split(fName, ".")
parts = Split(fName, parts(0))
warning = False
Select Case parts.Length
Case Is < 5 ' not a valid filename, do nohting
Return
Case 5 ' old style file name
art = part(0)
objnr = part(1)
text = part(2)
index = part(4)
Case 6 ' new stype file name
art = part(0)
phase = part(1)
objnr = part(2)
text = part(3)
index = part(5)
Case Is > 6 ' user used _ in text, do what we can and issue warning
art = part(0)
phase = part(1)
objnr = part(2)
text = part(3)
index = part(5)
warning = True
End Select
End Sub