C# WinForm 开发 EXCEL 读入问题
EXCEL 读入代码结构如下:
try
{
using (ExcelComApplication appExcel = new ExcelComApplication())
{
…… 处理数据部分
// 当出现数据异常时,直接Return,但是跳出using 特别的慢,数据量大的话得10秒以上才能跳出了
如:
//顧客ファイルに必須チェック
if (String.IsNullOrEmpty(CustomerNo))
{
MessageBox.Show(
L4Message.Get("JPE0057"), "ERROR",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
……
}
}
catch (Exception)
{
//ファイルのデータの読込が失敗しました。
MessageBox.Show(
L4Message.Get("JPE0063"), "ERROR",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}