Read/write Excel spreadsheet from

Posted on 2005-04-18
Last Modified: 2008-03-03
I need to read data from a database, populate an Excel spreadsheet and get it to do some fancy calculations, and display the results on a webpage (matching Excel cells to HTML textboxes), preferably using and without 3rd party software. How can this be done.
Please provide an example of how to do this.

Question by:rwallacej
    LVL 8

    Expert Comment

      Dim oExcel As Excel.Application
            Dim oWorkBook As Excel.Workbook
            Dim oWorkSheet As Excel.Worksheet
            oExcel = New Excel.Application
            oWorkBook = oExcel.Workbooks.Open(Server.MapPath("") & "\MBA 200510.xls")
            oWorkSheet = oWorkBook.Worksheets().Item(1)
       Dim o As Excel.Range = oWorkSheet.Cells.Item(i, j)

    o.value2 corresponds to the value of the cell u can get or set this property

    Author Comment

    Do I need import statements - I get "not defined" for all the lines "Excel."
    LVL 8

    Expert Comment

    ya u have to add a reference
    right click reference choose "add reference" go to the com tab and choose "Microsoft 11.0 object library"

    Author Comment

    thanks. I've tried this on a PC with Excel and it works but doesn't on a PC without Excel.

    The problem now is that client doesn't want to install Excel on their server. Can I read/write from an excel file (and have it update the calculated cells) WITHOUT excel installed?  
    LVL 8

    Accepted Solution

    i dont think can u work with excel functionality and have no excel!!!

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    This video discusses moving either the default database or any database to a new volume.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now