Spreadsheetlight save as working too slow

997 Views Asked by At

I am working on a winform with spreadsheetlight library.I want to create a excel file with specific name under a specific folder when user clicked on "Save to Excel" button. Ihave tried the below code so far.

string path = System.IO.Path.GetTempPath();

sl.SaveAs(path + "\\" + dosyaismi + ".xlsx");
FileInfo fi = new FileInfo(path + "\\" + dosyaismi + ".xlsx");
if (fi.Exists)
{
    System.Diagnostics.Process.Start(@path + "\\" + dosyaismi + ".xlsx");
}
else
{
    MessageBox.Show("Dosya bulunamadı!");
}

When program run and clicked that button first time it takes 2 minutes to create file.But without closing program I clicked that button again with different filename it creates file immediately.

I searched for 2 hours but ı didn't find any solution.Can anyone help what is the problem?

0

There are 0 best solutions below