1
我有一个问题,我无法解决,直到现在。 我在窗体上放了一个按钮。如果不写代码。我可以点击它没有任何问题。如果我写了一些代码然后评论这段代码,我得到这个错误:Sub或函数未定义。我怎么解决这个问题?vba中的子功能或函数未定义错误
Private Sub Command40_Click()
'Dim fso As New FileSystemObject
'Dim ts As TextStream
'Dim Name, Line As String
'Dim regn As New regexp
'Dim regx As New regexp
'Dim regend As New regexp
'Dim regxnum As New regexp
'Dim swknnf As Boolean
'Dim matchkennfeld, matchstx, matchend, matchxnum As MatchCollection
' Name = util1.fDateiName("*.DCM", "Text")
' Set ts = fso.OpenTextFile(Name, ForReading)
'Do While Not ts.AtEndOfStream
' set Line = ts.ReadLine
'regn.Pattern = "KENNFELD\s+([A-Z 0-9]*)"
' regx.Pattern = "\s*(ST/X)\s*([0-9]*\.[0-9]*\s*)+"
' regxnum.Pattern = "\s*[0-9]*\.[0-9]*\s*"
' regend.Pattern = "\s*(END)\s*"
' Set matchkennfeld = regn.Execute(Line)
' Set matchstx = regx.Execute(Line)
' Set matchend = regend.Execute(Line)
' If matchkennfeld.Count <> 0 Then
' swknnf = True
' End If
' If matchend.Count <> 0 Then
' swknnf = False
' End If
' If matchstx.Count <> 0 And swknnf = True Then
' Set matchxnum = regxnum.Execute(Mid(Trim(matchstx.Item(0)), 5))
' For Each Match In matchxnum
' MsgBox Match
' Next Match
' End If
'Loop
End Sub