Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default OpenXML - Excel - .NET - Rows and Cells

Hi,

I'm using OpnXML to manipulate an existing Excel file. I'm using Visual
Studio 2005, and referencing the .NET framework 3, but I cannot use LINQ
syntax, I have to navigate thru the structures by using loops.

I have 3 questions:

1) Is there a better way to access cells in my case that LINQ is unavailable
than looping?

2) When iterating thru the rows, and the cells in each row as below:

For Each oRow As Spreadsheet.Row In oRows
'aCells is defined before, outside the loops.
aCells = oRow.Descendants(Of Spreadsheet.Cell)()

For Each oCell As Spreadsheet.Cel in aCells
<do something
Next
Next

I noticed some cells are skipped. For example, row 1 starts, and the 1st
iteration in the loop that processes all the cells for that row. The 1st cell
we looped thru showed cell column "A" (in the oCell.CellReference.Value
member), and the 2nd iteration had column "I". It seems that some columns are
being skipped although the skipped columns are visible in the spreadsheet.
Any ideas of why is that happening?

3) When looping thru the rows and columns using for example:

For Each oRow As Spreadsheet.Row In oRows ... Next

do the OpenXML library return the rows ordered by their row number and/or
the cells ordered by their column name (letters)? They seem to come in order
by stepping thru the code, but is that guaranteed?

Thank you in advance,

Richard


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I stop Excel 2007 from asking to save my xls to OpenXML For QA Setting up and Configuration of Excel 0 March 25th 08 09:56 PM
OpenXML Excel query Sarang Bapat Excel Programming 0 August 8th 07 11:33 AM
Excel OpenXML Readers Gary Howlett Excel Programming 0 May 18th 07 01:58 PM
Excel crash when doing OpenXML, apparently involving DisplayAlerts [email protected] Excel Programming 0 March 30th 07 04:08 PM
UNMERGE two cells/rows in Excel Larry D. Excel Discussion (Misc queries) 1 January 28th 05 09:00 PM


All times are GMT +1. The time now is 03:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"