Private Sub ShowXData() Dim dataType As Variant Dim data As Variant
objCurrent.GetXData "XData", dataType, data
Dim i As Integer For i = LBound(dataType) To UBound(dataType) Select Case dataType(i) Case 1001 txtAppName.Text = data(i) Case 1000 txtString.Text = data(i) End Select Next i End Sub
Private Sub CommandButton1_Click() Dim txt As Control For Each txt In frmMain.Controls If TypeOf txt Is TextBox Then If txt.Text = "" Then MsgBox "文本不能为空", vbCritical Exit Sub End If End If Next txt
Call SetEntXData End End Sub
Private Sub SetEntXData()
Dim dataType(0 To 1) As Integer Dim data(0 To 1) As Variant dataType(0) = 1001 data(0) = "XData" dataType(1) = 1000 data(1) = txtString.Text
objCurrent.SetXData dataType, data End Sub
每次运行都出现对象变量或with块变量未设置这个错误。
都是下面这行出错误。部知道什么原因。 objCurrent.SetXData dataType, data
我在公共模块申明了
Public addMode As Boolean Public objCurrent As AcadEntity
请帮我找一下问题,谢谢大家了。 |