[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2006-04-06
6
Medium Priority
?
138 Views
Last Modified: 2010-04-23
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
Comment
Question by:dba123
  • 3
  • 2
6 Comments
 
LVL 48

Accepted Solution

by:
Mikal613 earned 2000 total points
ID: 16391725
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
 
LVL 48

Expert Comment

by:Mikal613
ID: 16391731
you can use the Object to read the Actual TExt of the file
0
 
LVL 48

Assisted Solution

by:Mikal613
Mikal613 earned 2000 total points
ID: 16391737
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 96

Expert Comment

by:Bob Learned
ID: 16392976
Dog pile ;)

Bob
0
 
LVL 1

Author Comment

by:dba123
ID: 16445169
what is Dog Pile...formal definition please
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16446142
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

834 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