Announcement

Collapse
No announcement yet.

Windows 10 update breaks VBA

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Windows 10 update breaks VBA



    The latest Windows 10 update has apparently introduced a serious bug in VBA (I have tested this in Office 2010 and Office 365 so probably applies to all versions). It now seems that if a variant contains an empty array, attempting to pass this to a second variant produces an error. See below;

    Sub test()

    Dim x As Variant, y As Variant
    x = Array()
    y = x

    End Sub

    Sub test2(ParamArray pp())

    Dim x As Variant, y As Variant
    x = pp
    y = x

    End Sub

    Sub test3()

    test2
    End Sub


    Both test1 and test3 produce Run Time error 5 Invalid Procedure Call or Argument. The second example - a ParamArray with no parameters supplied - must be a rather common situation so I suspect a lot of code is going to break... Does anyone know how to get Microsoft to do something about this?

    Andrew
    Andrew

  • #2
    I am not sure how that ever worked. It does not work in Win7.

    Comment


    • #3
      It has worked for the last decade or so. But it seems now it is a known problem. On Windows 10

      https://support.microsoft.com/en-gb/...date-kb4512508

      see the last of the known issues. Also, for Windows 7. See

      https://support.microsoft.com/en-gb/...date-kb4512486

      And there are many reports coming in of this error.
      Andrew

      Comment


      • #4
        I do not generate any error
        If the solution helped please donate to RSPCA

        Sites worth visiting: Rabbitohs | Excel-it royUK | Excel Matters Rory | Kris' Spreadsheet Solutions | Domenic xl-central | The Smallman

        Comment


        • #5


          Windows 10 version 1903 build 18362.295 has the error. Earlier versions do not.

          Microsoft know about the problem and are working on a fix.

          Interestingly, an empty array generated by Array() produces the error. An empty array generated by Split("","|") does not.
          Andrew

          Comment

          Working...
          X