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: Most helpful
  1. 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
  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-15T14:22:53+00:00

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2019-08-15T13:28:02+00:00

    Scott:

    Thanks for the KB list.

    I was curious, why is this was an OS update problem rather than an Office update problem. VBA is an Office component. But I did a little more research and found the answer myself (so I'm sharing it here).  oleaut32.dll is a shared system file installed by the operating system not the applications (ie Office).

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2019-08-15T07:56:16+00:00

    Hi Scot,

    Thank you for the update.

    As per your suggestion, I am working around the issue by passing "Empty" instead of the empty ParamArray and detecting that within the inner function.

    For future reference, where am I actually supposed to go to report stuff like this to Microsoft? I couldn't find a way to report a problem with a specific Windows Update. I asked @MicrosoftHelps on Twitter and they directed me to UserVoice - which didn't seem right as it appears as more of an idea submission hub. So I found this forum and posted here.

    Thanks

    Chris

    Was this answer helpful?

    0 comments No comments