我在vba中使用string。我想做这样的事情:
Dim matchprodat, matchtxt As MatchCollection
rega2lhex.Pattern = "[\\][\w]*"
regprodat.Pattern = "(Datensatz:|Projekt:)[\s\w*,*]*[\\\w]*"
\\ I am reading each line of a text file
Set matchprodat = regprodat.Execute(line)
If matchprodat.Count <> 0 Then
Set matcha2lhex = rega2lhex.Execute(matchprodat.Item(0))
DCMname = DCMfilename + "<>" + Mid(matcha2lhex.Item(0), 2)
End if
但我收到错误:Run-time error '5': "Invalid procedure call or argument"
matcha2lhex.Item(0)
不为空且长度为8. Mid()中出现此错误的原因是什么?
如果我正在观察价值: