Solved

Reading a Excel sheet

Posted on 2007-12-04
2
514 Views
Last Modified: 2008-02-01
have a excel file which starts with a report info in first few rows of excel and then table.

For example:

Distribution Report:

  No of employees:
Date:
Amount:


Detail Table

empno    ssn        aadr1   addr2

1. How can i skip rows till table headers and read just the data from table in database or dataset using asp.net

2. How can we handle dynamic sheet names [sheet1$]while reading xls files?
0
Comment
Question by:rahulsurya
2 Comments
 
LVL 21

Accepted Solution

by:
surajguptha earned 250 total points
ID: 20407469
Check this out
http://blogs.vbcity.com/hotdog/archive/2006/01/12/5777.aspx

It has code to convert a excel sheet to a datatable. Once this is done you can remove the rows you dont want manually and then bind it to a grid...
0
 
LVL 28

Assisted Solution

by:iboutchkine
iboutchkine earned 250 total points
ID: 20418927
you can read any cell you want. Just skip the header part

 Dim oExcel As Object
        Dim wbk As Object
        Dim a As String

        oExcel = CreateObject("Excel.Application")

        wbk = oExcel.Workbooks.Open(Filename:="c:\temp\a.xls", UpdateLinks:=False, ReadOnly:=False)
        With wbk.ActiveSheet
            'read
            a = .Range("A1").Value
        End With ' wbk
        wbk.Close()
        wbk = Nothing
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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ā€¦
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how the fundamental information of how to create a table.

733 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