none
Latest Windows 10 update breaks VBA RRS feed

  • Question

  • 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...
    Andrew

    Thursday, August 15, 2019 1:27 PM

Answers

  • Well, at least they are aware of it:

    >>>>>>

    After installing this update, applications that were made using Visual Basic 6 (VB6), macros using Visual Basic for Applications (VBA), and scripts or apps using Visual Basic Scripting Edition (VBScript) may stop responding and you may receive an "invalid procedure call error."

    Microsoft is presently investigating this issue and will provide an update when available.

    Thursday, August 15, 2019 3:11 PM

All replies