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

前端 未结 3 2020
醉梦人生
醉梦人生 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:45

    The update affects VB6, VBA (including all versions of Office) as well as VBScript!

    Microsoft is currently looking into the issue: https://support.microsoft.com/en-us/help/4512488/windows-8-1-update-kb4512488 (look at the last row under the section entitled "Known issues in this update")

    Update:

    Microsoft just released a patch for this issue: https://support.microsoft.com/en-us/help/4517298/windows-8-1-update-kb4517298

    0 讨论(0)
  • 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
    
    0 讨论(0)
  • 2020-11-28 16:03

    For Windows 10 version 1709, this issue has been corrected with this update:

    https://support.microsoft.com/en-us/help/4512494/windows-10-update-kb4512494

    0 讨论(0)
提交回复
热议问题