E
elsvieta
hi all,
I am trying to force a Save dialog when saving my file from a ASP.NET simple
app.
The code I am having trouble with is below:
......
Microsoft.Office.Interop.Excel.ApplicationClass objApp = new
Microsoft.Office.Interop.Excel.ApplicationClass();
Microsoft.Office.Interop.Excel.Workbook objWorkBook = null;
Microsoft.Office.Interop.Excel.Worksheet objSheet = new
Microsoft.Office.Interop.Excel.Worksheet();
objWorkBook = objApp.Workbooks.Add(Type.Missing);
objSheet =
(Microsoft.Office.Interop.Excel.Worksheet)objWorkBook.Sheets[1];
objSheet.Name = "SUMMARY";
Microsoft.Office.Interop.Excel.Range objRange;
... some data added to the spreadsheet
objApp.DisplayAlerts = true;
objWorkBook.SaveAs(someFileName, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing,
Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlExclusive, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing);
When it saves it saves always to the same location/name provided throught
the someFileName string.
I can't make it prompt me so that I can choose a path and a name!!!
Can anybody show me how it's done?
Thanks,
elsvieta
I am trying to force a Save dialog when saving my file from a ASP.NET simple
app.
The code I am having trouble with is below:
......
Microsoft.Office.Interop.Excel.ApplicationClass objApp = new
Microsoft.Office.Interop.Excel.ApplicationClass();
Microsoft.Office.Interop.Excel.Workbook objWorkBook = null;
Microsoft.Office.Interop.Excel.Worksheet objSheet = new
Microsoft.Office.Interop.Excel.Worksheet();
objWorkBook = objApp.Workbooks.Add(Type.Missing);
objSheet =
(Microsoft.Office.Interop.Excel.Worksheet)objWorkBook.Sheets[1];
objSheet.Name = "SUMMARY";
Microsoft.Office.Interop.Excel.Range objRange;
... some data added to the spreadsheet
objApp.DisplayAlerts = true;
objWorkBook.SaveAs(someFileName, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing,
Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlExclusive, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing);
When it saves it saves always to the same location/name provided throught
the someFileName string.
I can't make it prompt me so that I can choose a path and a name!!!
Can anybody show me how it's done?
Thanks,
elsvieta