locked
Populating Excel Form from ASP.NET RRS feed

  • Question

  • User-664618749 posted

    Hi,

    I am automating an Excel spreadsheet from within an ASP.NET application as follows (using the Microsoft.Office.Interop.Excel assembly): 

    Application application = new ApplicationClass();
    application.Visible = false;
    Workbook workbook = application.Workbooks.Open(filepath,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                    Type.Missing, Type.Missing);
    Worksheet worksheet = (Worksheet)workbook.Worksheets["myForm"];
    

    The Excel worksheet contains a Form with several checkboxes. My question is how to check or uncheck a checkbox within this form using the object model above?

    Many thanks for any help or suggestions!

    Martin

    Tuesday, August 4, 2009 9:03 AM

All replies

  • User-319574463 posted

    Do you mean an ASP.NET web site or an ASP.NET web service?

    For the former, you can use the HTML Aglity Pack from: http://www.codeplex.com/htmlagilitypack

    Wednesday, August 5, 2009 6:33 AM
  • User-664618749 posted

     It is from a Wb site. I am actually automating the Excel application, i.e. running an separate instance of the Excel exe, and trying to manipulate this.

    Thursday, August 6, 2009 6:45 AM
  • User-319574463 posted

    Is the Excel spread sheet providing data to the web site or being written by the web site?

    Which version of Excel are you using?

    Thursday, August 6, 2009 11:53 AM
  • User-664618749 posted

     Hi,

    The Web site is writing to the Excel spreadsheet. It is Excel 2003.

     

    Thanks!

    Thursday, August 6, 2009 3:01 PM