title: how to close a file that is created by spire.xls
body: <p>I am converting a CSV Document to a PDF as shown in the code with Spire.XLS.
  The problem is that the File is still open after creation and I can't delete it while the programm is running. So does anyone know how I can close this file without closing the hole programm?</p>
  
  <pre><code>//check if open = false
          if (IsFileinUse())
          {
              Console.WriteLine("PDF open btn_ConvertToPDF_Click");
          }
          else
          {
              Console.WriteLine("PDF closed btn_ConvertToPDF_Click");
          }
  
          //code that creates the file but does not close it
          Workbook wb = new Workbook();
          wb.LoadFromFile(filename + ".csv", ",");
          wb.ConverterSetting.SheetFitToPage = true;
          Worksheet sheet = wb.Worksheets[0];
          for (int i = 1; i &lt; sheet.Columns.Length; i++)
          {
              sheet.AutoFitColumn(i);
          }
          sheet.SaveToPdf(filename+".pdf");
  
          //check if open = true
          if (IsFileinUse())
          {
              Console.WriteLine("PDF open btn_ConvertToPDF_Click");
          }
          else
          {
              Console.WriteLine("PDF closed btn_ConvertToPDF_Click");
          }
  </code></pre>