當我嘗試在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