Excel Interop - Set filename before saving

Viewed 2942

Is it possible to set the excel filename before file saving?

I have following simple code:

using Excel = Microsoft.Office.Interop.Excel;

Excel.Application excel = new Excel.Application();
excel.Visible = true;
Excel.Workbook workbook = excel.Workbooks.Add(Excel.XlSheetType.xlWorksheet);
Excel.Worksheet sheet = workbook.Sheets[1];

sheet.Cells[1, 1] = "Hello World!";

Is it possible to predefine this name before saving?

enter image description here

Thanks.

2 Answers
Related