我用VC作了一个自动化对象,在VBA中调用它的方法,代码:
Dim BOM As Object
Sub CATMain()
Set BOM = CreateObject("BOMDll.BOMSheet")
Dim Value
Set Value = BOM.Display()
End Sub
运行结束时,系统提示:运行时错误‘13’:类型不匹配
请问这是怎么回事?
Sub BianLiShu(oProduct As Product)
Dim oProducts As Products
Set oProducts = oProduct.Products
Dim count As Integer
count = oProducts.count
If count = 0 Then
Msgbox oProduct.partnumber
Else
Dim i As Integer
For i = 1 To count
Dim oProduct1 As Product
Set oProduct1= oProducts.Item(i) Call BianLiShu(oProduct1)
Next i
End If
End Sub