我有这个项目可以在 Excel 32 位上正常工作,但是在 64 位上运行它时遇到问题。
我有这部分处理无效公式(那些无法由 excel 评估的东西。) 32 位用于抛出我可以捕获的错误,但在 64 位中,我似乎有我不确定的问题。代码有点卡住了。
Sub Macro1()
Dim x As Variant
On Error Goto ErrH:
ReDim x(1, 1)
x(0, 0) = "=1+1"
x(0, 1) = "=1+ " ' <--this is a sample of what I refer to as Invalid formula
x(1, 0) = "=1+2"
x(1, 1) = "=1+1"
Range("A1:B2").Value = x ' <--Im stuck in this part.
' the program does not proceed beyond this point
' and does not throw error like it used to.
'I do something here
On Error Goto 0
Exit Sub
ErrH:
' I have bunch of stuffs that I do here, basically, Error handling.
End Sub
我需要做什么才能让 Excel 在我在代码中指示的行上抛出错误?