Sending object array to variant works before August 2019 Windows update, but fails after update

前端 未结 3 2034
醉梦人生
醉梦人生 2020-11-28 15:31

Running the subroutine RunMe works before August 2019 Windows update.

Running the subroutine RunMe fails after August 2019 Windows update. It reports the following e

3条回答
  •  春和景丽
    2020-11-28 15:50

    To fix, change the ByVal to ByRef in the function:

    Public Sub RunMe()
      Dim wksTestArray() As Worksheet
      MsgBox SendArrayToFunction(wksTestArray())
    End Sub
    
    Public Function SendArrayToFunction(ByRef vntArray As Variant) As Boolean
      SendArrayToFunction = True
    End Function
    

提交回复
热议问题