次の方法で共有


XmlMappedRange.Errors プロパティ

XmlMappedRange コントロールのエラー チェック オプションにアクセスするための Errors オブジェクトを取得します。

名前空間:  Microsoft.Office.Tools.Excel
アセンブリ:  Microsoft.Office.Tools.Excel (Microsoft.Office.Tools.Excel.dll 内)

構文

'宣言
ReadOnly Property Errors As Errors
    Get
Errors Errors { get; }

プロパティ値

型: Microsoft.Office.Interop.Excel.Errors
XmlMappedRange コントロールのエラー チェック オプションにアクセスするための Errors オブジェクトを返します。

解説

エラー チェック オプションに関連付けられたインデックス値の一覧を確認するには、Errors オブジェクトを参照します。

次のコード例は、テキストとして書かれた数値を XmlMappedRange に挿入し、Errors プロパティを使用して、数値がテキストとして書かれているかどうかを判断します。 このコード例では、現在のワークシートに CustomerLastNameCell という名前の XmlMappedRange が含まれているものと仮定しています。

Private Sub CheckForErrors()
    Me.CustomerLastNameCell.Formula = "'12"

    If Me.CustomerLastNameCell.Errors( _
        Excel.XlErrorChecks.xlNumberAsText).Value Then
        MsgBox("The number is written as text.")
    Else
        MsgBox("The number is not written as text.")
    End If
End Sub
private void CheckForErrors()
{
    this.CustomerLastNameCell.Formula = "'12";

    if (this.CustomerLastNameCell.Errors[
        Excel.XlErrorChecks.xlNumberAsText].Value)
    {
         MessageBox.Show("The number is written as text.");
    }
    else
    {
        MessageBox.Show("The number is not written as text.");
    }
}

.NET Framework セキュリティ

  • 直前の呼び出し元に対する完全な信頼。 このメンバーは、部分的に信頼されているコードから使用することはできません。 詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

XmlMappedRange インターフェイス

Microsoft.Office.Tools.Excel 名前空間