Windows Update 2019-08 Cumulative Update has broken VBA code use case

Anonymous
2019-08-14T10:33:56+00:00

An issue with VBA code has started to be seen by some of my users and also by me this morning. I have tracked it down to have been caused by the latest 2019-08 Cumulative Update (e.g. KB4511553) and it is affecting all combinations of Windows and Office that I have seen so far- from Windows Server 2008 to Windows 10 & Office 2003(!) to Office 2016. 

The test code below demonstrates the problem. The method "Test" executes with no errors before the 2019-08 cumulative update is installed (or after it is uninstalled). However, after the update, the scenario of passing an empty ParamArray parameter to another method as a Variant parameter causes an error to be thrown on the declaration line of the second method. (Error 5: Invalid procedure call or argument).

Sub Test()

    Test1 "A", "B"   'Works OK with and without Windows Update

    Test1            'Fails after Windows Update

End Sub

Sub Test1(ParamArray P() As Variant)

    Test2 P

End Sub

Sub Test2(ByVal P As Variant)    'Error occurs on this line

End Sub

This is causing errors in my Microsoft Access application, but I have also tried this code in Word 2016 and the same issue occurs there too.

Can somebody validate this, please? I'm not really sure what the correct way of reporting this problem is.

Thanks

Chris

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

43 answers

Sort by: Oldest
  1. Anonymous
    2019-08-15T14:45:27+00:00

    Hi Chris,

    The most effective way to engage us is by creating a support case. Start from this webpage

    https://support.microsoft.com/en-us

    and click the "Contact Us" link.  There are multiple options, depending on the product and how you want to communicate with us.

    In this particular case, I agree that it's not obvious which product or path to choose.  To some, it would appear to be an Office product issue, when it turns out to have been a change to a Windows component (oleaut32.dll), but you wouldn't have known that unless we told you.

    When you are the developer of the software in question, and your software is having an issue with Microsoft components, it's almost always best to choose the developer tools you used when asking for a support case. But if you used Visual Basic 6, you won't find that as an option, since we no longer support VB6 development. I know, it's frustrating. If you created an app with VB6 and feel certain that a Microsoft change has caused your app to break (as was the case when our update to oleaut32 broke several VB6 apps and VBA scripts), choose Visual Studio as the product, and it will end up with the correct team. We can help work it out from there.

    If it was a VBA script in an Office product (Excel, Word, etc.), then choose Office as the supported product, and choose subtopics related to scripting. 

    In both cases this time, the resolution will actually come from Windows product engineering, since the shared oleaut32 is used across many other products, and it just happens to have caused problems with apps using SafeArrays and Variants, which are most commonly used in VB6 and VBA (but also used in some C++ apps). This particular regression was related to trying to copy an empty safearray to a variant.  But you probably wouldn't know that just because your code called a function with an empty ParamArray, or tried to assign Array() to a variable.

    Whenever possible, choose the product in use that requires the most technical specialty, and you'll get more advanced support.

    Scot

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2019-08-16T07:55:44+00:00

    This is also happening, when passing the empty array to a Sub/Function.

    In this case it will only occur if it is passed with "ByVal".

    If passing the parameter "ByRef" the issue does not occur.

    Class1:

    Option Explicit

    Public Type MyType

      Prop1 As Integer

    End Type

    Sub Test()

      On Error Resume Next

      Dim Arr() As Object

      TestByRef Arr           'Works before and after Windows Update

      TestByVal Arr           'Fails after Windows Update

      Dim Arr2() As MyType

      TestByRef Arr2          'Works before and after Windows Update

      TestByVal Arr2          'Fails after Windows Update

      Dim Arr3() As Class1

      TestByRef Arr3          'Works before and after Windows Update

      TestByVal Arr3          'Fails after Windows Update

      Dim Arr4() As Variant

      TestByRef Arr4          'Works before and after Windows Update

      TestByVal Arr4          'Works before and after Windows Update

      Dim Arr5() As Integer

      TestByRef Arr5          'Works before and after Windows Update

      TestByVal Arr5          'Works before and after Windows Update

    End Sub

    Sub TestByRef(ByRef P As Variant)

    End Sub

    Sub TestByVal(ByVal P As Variant)    'Error occurs on this line

    End Sub

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2019-08-16T13:49:10+00:00

    Yes, your observation is perfectly consistent with the change that was introduced with the update. If your code doesn't require copying the contents of an empty array to the variant, then it doesn't flag it as invalid. ByRef doesn't require a copy to be made, but ByVal does.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2019-08-16T18:20:14+00:00

    Official update so far:

    "We will release a fix for this issue over the coming days as part of the ‘optional’ C update, which we are releasing early to address this issue. Note we are confirming which channels customers can pick up the update. Windows Update for Business customers will need to apply the update via Microsoft Update Catalog or Windows Server Update Services (WSUS)."

    Translation: We have a fix that we have tested on some platforms, and still waiting on testing in other platforms, and our release schedule will depend on which version of Windows you have, and how you obtain updates. In some cases, I think the release may even be this afternoon.  In other cases, maybe another week or so.  Or somewhere in between.

    That's all I have for now.

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2019-08-16T19:54:13+00:00

    Thanks again Scott.

    You get an anonymous "atta-boy" in this article (I have no association with the site)

    2019 08 16- Windows update causes Office VBA to fail

    https://office-watch.com/2019/windows-update-causes-office-vba-to-fail/

    Was this answer helpful?

    0 comments No comments