我有这个项目,与Excel 32位工作正常,但我有问题在64位运行它。无效的公式不会抛出错误-VBA Excel 2010 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做些什么来在我的代码中指出的行上抛出错误?
感谢您的快速响应。但我不能用这个理由有两个原因,第一,你的建议只限于我给出的那些公式。我们的代码使用更复杂的Excel公式函数,如AVERAGE,COUNT,IF等,我们也使用命名范围。第二,处理我们所做的事情需要时间,我们通常处理超过65k行和大约500列,循环遍历单元格会花费时间。我保证在我们迁移到64位办公室之前,以我所做的方式显示2D并不会导致问题。我只想知道为什么64位Excel不会像过去那样抛出错误 – user2345501 2013-05-03 05:32:52