• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 141
  • Last Modified:

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

Environment:
------------------

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: http://www.webfound.net/excelfile.xls

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
0
dba123
Asked:
dba123
  • 3
  • 2
2 Solutions
 
Mikal613Commented:
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
0
 
Mikal613Commented:
you can use the Object to read the Actual TExt of the file
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
Bob LearnedCommented:
Dog pile ;)

Bob
0
 
dba123Author Commented:
what is Dog Pile...formal definition please
0
 
Bob LearnedCommented:
U.S. slang term

http://www.answers.com/topic/dogpile

===============================================

[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 =:)

Bob
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now