title: Change color in excel file
body: <p>I will change the color of some Excel Cells and I use the following function for it:</p>
  
  <pre><code>  private void FormatFile(Excel.Borders _borders)
          {
              _borders[Excel.XlBordersIndex.xlEdgeLeft].LineStyle = Excel.XlLineStyle.xlContinuous;
              _borders[Excel.XlBordersIndex.xlEdgeRight].LineStyle = Excel.XlLineStyle.xlContinuous;
              _borders[Excel.XlBordersIndex.xlEdgeTop].LineStyle = Excel.XlLineStyle.xlContinuous;
              _borders[Excel.XlBordersIndex.xlEdgeBottom].LineStyle = Excel.XlLineStyle.xlContinuous;
              _borders.Color = ConsoleColor.Black;
  
              _range = _xlWorkSheet.get_Range("A1:AG100");
              _range.EntireColumn.AutoFit();
              _range.EntireRow.AutoFit();
  
              Excel.Range colorRange;
              colorRange = _xlWorkSheet.get_Range("y1", "ag100");
              colorRange.Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.LightGray);
          }
  </code></pre>
  
  <p>It works fine but when the Program will save the file it comes this screen:</p>
  
  <p><a href="https://i.stack.imgur.com/tPA20.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tPA20.png" alt="enter image description here"></a></p>
  
  <p>Do you have an idea how to change it that I don't become that window ?</p>
  
  <p>I save the file with this function:</p>
  
  <pre><code>   internal string SaveFile(string writePath)
      {
          FormatCells(_xlWorkSheet.Cells.Borders);
          string fileName = string.Format("{0}_{1}.xlsx","running_", DateTime.Now.ToString("yyyyMMdd_HHmmss"));
          _xlWorkBook.SaveAs(Path.Combine(writePath, fileName), Excel.XlFileFormat.xlWorkbookNormal, misValue,
             misValue, misValue, misValue, Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);
          _xlWorkBook.Close(true, misValue, misValue);
          _xlApp.Quit();
  
          ReleaseObject(_xlWorkSheet);
          ReleaseObject(_xlWorkBook);
          ReleaseObject(_xlApp);
          return fileName;
      }
  </code></pre>