Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 10th, 2007, 12:47 AM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 180
Thanks: 1
Thanked 1 Time in 1 Post
Send a message via ICQ to dpkbahuguna Send a message via MSN to dpkbahuguna Send a message via Yahoo to dpkbahuguna
Default 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..
 
Old March 10th, 2007, 07:47 PM
Friend of Wrox
 
Join Date: Apr 2004
Posts: 204
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You're passing in the wrong number of arguments to the SaveAs method. Use the intellisense feature to get a list of the necessary agruments. Keep in mind, sometimes there are multiple variations on the arguments you need to supply. Those variations are called overloads, hence the message. Read the documentation on the Excel.Application class and SaveAs method specifically.

HTH

Aaron






Similar Threads
Thread Thread Starter Forum Replies Last Post
Save a file in CSV format thru Excel VBA macro roli2712 Excel VBA 1 July 11th, 2007 03:05 AM
Excel Workbook Save: Trap Temp file creation Shasur Excel VBA 0 July 3rd, 2006 10:07 PM
Save PDF file as text file in VB.Net kvenkatu Classic ASP Basics 0 April 7th, 2006 01:09 PM
save a PDF file as text file through VB. NET kvenkatu VB.NET 0 April 6th, 2006 12:15 PM
XMLHttp ... save it as Excel file .. vmvadivel SQL Server DTS 0 November 30th, 2005 08:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.