初始化2D阵列时出现运行时错误5 [英] Run Time Error 5 when initializing a 2D array
问题描述
我一直在使用Arr=Array(Array(),Array())
初始化2D数组.
I have been initializing a 2D array using Arr=Array(Array(),Array())
.
但是我发现运行时错误5-无效的过程调用或参数将被触发.
But I have found that a Run Time Error 5 - Invalid Procedure Call or Argument would be triggered.
该代码已经使用了多年,并且昨天出现了问题,所以我认为这可能是MS Office或Windows的某些更新的结果.
The code have been used for years and the problem arose yesterday so I think it may be the result of some of the updates for MS Office or Windows.
更新:Windows 10,Windows 7存在错误,但Windows Vista不存在.
重现该错误:
Sub foo()
Dim Arr As Variant
Arr = Array(Array(), Array())
End Sub
推荐答案
这是由于Microsoft在2019年8月13日推送的安全更新中发现的一个错误(
This is due to a bug discovered in the security update that was pushed by Microsoft on 8/13/2019 (https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2019-1182)
查找与您的Windows版本相关的KB号,然后键入(32/64位)并卸载更新.这样可以解决问题.
Look for the KB number related to your version of Windows and type (32/64 bit) and uninstall the update. This will fix the issue.
Microsoft正在研究修复更新中的错误.
Microsoft is looking into fixing the bug in the update.
更新
Microsoft刚刚发布了一个修补程序: https ://support.microsoft.com/zh-CN/help/4517298/windows-8-1-update-kb4517298
Microsoft just released a patch: https://support.microsoft.com/en-us/help/4517298/windows-8-1-update-kb4517298
这篇关于初始化2D阵列时出现运行时错误5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!