//Wait For Save
int Cnt = 0;
while (true)
{
try
{
LogNO = 100;
System.IO.FileStream fs;
LogNO = 101;
fs = System.IO.File.Open(excelFileName, System.IO.FileMode.Open, System.IO.FileAccess.ReadWrite);
LogNO = 102;
fs.Close();
break;
}
catch
{
LogNO = 103;
Cnt++;
System.Threading.Thread.Sleep(500);
if (Cnt > 120)
{
Exception ee = new Exception("ExcelPrintOpen TimeOut [ LogNO = " + LogNO + "]");
throw ee;
}
}
}
LogNO = 104;
System.Diagnostics.Process.Start(excelFileName);
int Cnt = 0;
while (true)
{
try
{
LogNO = 100;
System.IO.FileStream fs;
LogNO = 101;
fs = System.IO.File.Open(excelFileName, System.IO.FileMode.Open, System.IO.FileAccess.ReadWrite);
LogNO = 102;
fs.Close();
break;
}
catch
{
LogNO = 103;
Cnt++;
System.Threading.Thread.Sleep(500);
if (Cnt > 120)
{
Exception ee = new Exception("ExcelPrintOpen TimeOut [ LogNO = " + LogNO + "]");
throw ee;
}
}
}
LogNO = 104;
System.Diagnostics.Process.Start(excelFileName);