当我尝试在Autocad中运行此VBA代码时,出现“类型不匹配”错误。突出显示行Theatts(TagNumber).TextString = BTextString
。VBA中的类型不匹配
Public acad As Object
Public doc As Object
Public ms As Object
Public ss As Object
Public ssnew As Object
Public Theatts As Variant
Public MsgBoxResp As Integer
'declare global variables
Sub UpdateAttrib(TagNumber As Integer, BTextString As String)
'This Sub Procedure tests the attribute data to check
'that is not a null value
If BTextString = "" Then
'if the attribute is empty
Theatts(TagNumber).TextString = ""
'put a '-' place holder
Else
'if it is not empty
Theatts(TagNumber).TextString = BTextString
'use the attribute value
End If
End Sub
Sub setupsv()
'name of function
UserForm1.show
'display the dialogue box
'UserForm1
End Sub
什么是Theatts应该是?它看起来完全是单元化 –
格式化您的代码将有助于... – Bart
@约翰科尔曼:Theatts的声明是在他的代码的无格式部分... – Bart