How to strip out rows in my Excel file and leave only Detail Rows

Posted on 2006-04-06
Last Modified: 2010-04-23

Running this code on my PC via VS 2005
.Net version 2.0.50727 on the server (shown in IIS)
Code is in ASP.NET 2.0 and is a VB.NET Console application

Problem & Info:

I am bringing in an Excel file.  I need to first strip out any non-detail rows such as the breaks you see with totals and what not.  I should in the end have only detail rows.   The incoming Excel file is here:

Desired Help:

How to perform

1)      Need to know syntax (how-to) and classes to allow me to read and stripping out all undesired rows in VB.NET for the incoming Excel File.  I've done this with a txt but never an Excel doc
2)      importing each column into sql table - just need to know how to grab each column from the excel after #1...I can do the DB portion myself
Question by:dba123
    LVL 48

    Accepted Solution

    To open a Excel file on a button click..

    1. U need to add Microsoft Excel 9.0 Object library reference in your project. Yes there will be problems if the client computer  has a different version of Microsoft Office. So it is better that during the time of deployment u compile the project with the same version as that present on the client computer

    2. Open a excel file on button click

    Dim ExcelObj as Excel.Application
    Sub ExcelBtn_Click(sender As Object, e As EventArgs)
                 ExcelObj = new Excel.Application()
    me.openFileDialog1.FileName = "*.xls";
      if (me.openFileDialog1.ShowDialog() == DialogResult.OK)
      // ***********  Here is the call to Open a Workbook in Excel ****************
      // It uses most of the default values (except for the read-only which we set to true)
       Dim theWorkbook  as   Excel.Workbook
       theWorkbook = ExcelObj.Workbooks.Open(
              openFileDialog1.FileName, 0, true, 5,
              "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false,
              0, true)

             End if
          End Sub
    LVL 48

    Expert Comment

    you can use the Object to read the Actual TExt of the file
    LVL 48

    Assisted Solution

    LVL 96

    Expert Comment

    by:Bob Learned
    Dog pile ;)

    LVL 1

    Author Comment

    what is Dog Pile...formal definition please
    LVL 96

    Expert Comment

    by:Bob Learned
    U.S. slang term


    [Usenet: prob. fr. mainstream “puppy pile”] When many people post unfriendly responses in short order to a single posting, they are sometimes said to “dogpile” or “dogpile on” the person to whom they're responding. For example, when a religious missionary posts a simplistic appeal to alt.atheism, he can expect to be dogpiled.

    It has been suggested that this derives from U.S. football slang for a tackle involving three or more people; among hackers, it seems at least as likely to derive from an ‘autobiographical’ Bugs Bunny cartoon in which a gang of attacking canines actually yells “Dogpile on the rabbit!”.


    It's when everybody jumps on an easy question.

    I posted in the wrong question, though.  So, that is the funniest part of all, because it doesn't make any sense here =:)


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    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.

    I'm currently working for a company where I have to upgrade over 50 VB6 programs to VB.NET 2008.  So far I'm about half way through, and I've learned quite a few tricks that drastically improve the performance of VB.NET apps. Because there are a…
    This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    737 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

    19 Experts available now in Live!

    Get 1:1 Help Now