VBA如何向函数传递结构体参数
Private Type BOMstruct
BOMname As String
qty As Integer
End Type
Dim objBOM As BOMstruct
Dim iStack() As BOMstruct
Dim TailPointer As Double
Private Sub Push(BOM As BOMstruct)
ReDim Preserve iStack(TailPointer)
iStack(TailPointer) = BOM
TailPointer = TailPointer + 1
End Sub
Sub TEST()
Push(objBOM) 'compile error- variable can't assign to this expression
End Sub
[解决办法]
Push(objBOM)
也许改为
Push objBOM