Jump to content
Xtreme .Net Talk

Mortious

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by Mortious

  1. Ahh just figured it out. Its counting all cells used.
  2. Ok I have worked with this a bit and took what I needed to try and make it work, the closest I have so far.. This code snip: objSheet.UsedRange.Count When I evaluate it in debug, it returns a value of 3987. The excel sheet Im pulling from only has 400 rows that are actually populated, so its not quite there... Im sure Im missing one thing, I just can't seem to put my finger on it.
  3. Will this work for the Excel 9.0 library?
  4. In VB6.0, I have the following code. With this code Im able to get a valid count of all of the rows "populated" or as we call it a "record count", and pulling the sheet name from sheet 1. Dim wkb As Excel.Workbook Dim wks As Excel.Worksheet Set wkb = Workbooks.Open(CommonDialog1.FileName) ' Open your file xlsWorkSheet = wkb.Worksheets(1).Name ' Gives name of first worksheet. Set wks = wkb.Worksheets.Item(1) ' Set up the worksheet wks.UsedRange.Select ' Grab all used rows XLSCount = Selection.Rows.Count ' Count the used rows wkb.Close True, CommonDialog1.FileName ' Close the file when your done. When I upgraded this code to .NET, Im having issues with this. I have all variables already declared (I omitted them for clarity).
  5. Im going from VB6.0 to .NET and have a couple of questions. My first one (and the only one Ill ask right now) is how do I handle flat text file IO. I have seen the examples below of this and those definatly help, but I don't want to hard code the path of the file. In VB 6 I could use app.path with the rest of the file information to grab it, is there a .NET variance of app.path? BTW I don't have the MSDN help libraries installed yet (waiting on the help desk guys to do that). Thanks.
×
×
  • Create New...