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