我想从网格中捕获一个缺失值,并将其作为默认值传递给另一个过程。
我知道ex.message是"指定的参数超出了有效值的范围。"
但与旧的Err.xxx不同,您可以通过此方式获取其描述和数字,例如:
选择Case Err.Number
案例3021
做某事
所以我怎么知道自己是什么"捕捉"基于ex.Message?没有ex.ErrorNumber或Phrase
Try
Session("gblStoreID") = selectedRow.Cells(4).Text' < Error happens here since there is no column 4, some times...
Catch ex As **What_Goes_Here**
'So I want to just make the session var 5
Session("gblStoreID") = 5
Catch ex As Exception
debug.print ex.Message
End Try