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 がエラーをスローするには、どうすればよいですか?