0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

C# VSTO Excelアドインでの空白セルチェック

Last updated at Posted at 2024-02-16

概要

業務でVSTOを利用したExcelアドインを作成しています。その中で空白セルのチェックを
したかったのですが簡単にはいかず色々試して解決できたので備忘録として残します。

環境

VisualStudio2022 C# .NET Framework4.8

コード


//A1セルのデータ有無をチェック

 Excel.Worksheet actSheet = Globals.ThisAddIn.Application.ActiveSheet;

 if (string.IsNullOrEmpty(Convert.ToString(actSheet.Cells[1, 1].Value)))
 {
     MessageBox.Show("空です");
 }
 else
 {
     MessageBox.Show("データあり");
 }

参考サイト

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?