Save Excel file.
Hi friends..
i am making an excel file. But getting error when saving it dont know why. Can someone tell what is the proble.
I am getting error in "xws.SaveAs("c:\\temp\\MyFile.xls");" this expression wht is the wrong with this. help me.
Exception Being raised : "No overload for method 'SaveAs' takes '1'".
Pls tell me wht is the problem.
waiting for reply.....
my programe is here below:
---------------------------------------------------------------
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Excel.Application xapp;
Excel.Workbook xwb;
Excel.Worksheet xws;
xapp = new Excel.Application();
xapp.Visible = true;
xwb = (Excel.Workbook)(xapp.Workbooks.Add(1));
xws = (Excel.Worksheet)xwb.ActiveSheet;
xws.Cells[1, 1] = "deepak";
xapp.UserControl = true;
xws.SaveAs("c:\\temp\\MyFile.xls");
}
---------------------------------------------------------------
DPK..
__________________
DPK..
|