Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8799311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:17:25+00:00 2026-06-14T00:17:25+00:00

According to the OpenXml spec CellReference is optional. But is there an alternative way

  • 0

According to the OpenXml spec CellReference is optional. But is there an alternative way to get a cell’s location?

For example, I can get a row’s cells by something like:

foreach (Row r in sheetData.Elements<Row>())
{
    foreach (Cell c in r.Elements<Cell>())
    {
        Console.WriteLine(c.CellReference);
    }
} 

But without CellReference, how do I know the cells’ locations?

I have done some research and all solutions seem to rely on comparing a cell’s CellReference against a given string.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:17:27+00:00Added an answer on June 14, 2026 at 12:17 am

    The CellReference is optional because if it’s missing, Excel uses the “first come first served” principle (that’s not the official term by the way).

    What happens when all your Cell classes have missing CellReference properties is that Excel will parse based on the order in which it encounters Row and Cell classes.

    The 1st Row class (you will note that the RowIndex is also an optional property) that’s in the SheetData class will be assumed to have row index 1. And the 1st Cell class in that row is assumed to have the CellReference “A1” (assuming the Cell has no CellReference assigned). And the 2nd Cell class in that row is assumed to have the CellReference “B1”. And so on and so forth.

    The next Row class (if the RowIndex property is also not assigned) will be assumed to be the 2nd row.

    Basically, if all the RowIndex and CellReference properties are missing, all your Cell classes are bunched together at the top-left corner of your worksheet.

    Hypothetically speaking, if you have 3 unassigned RowIndex-ed Row classes and the next Row class has a RowIndex of 8, that’s a valid worksheet. You’ll just have the first 3 rows of data in the first 3 rows in the worksheet (as expected), and the “4th” Row class (with the RowIndex of 8) as the 8th row in the worksheet.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to Josh Bloch in Java: There is no way to extend an instantiable
According to this post in Recursive Descent vs. LALR , any LALR(k) can be
According to Microsoft ( link ), there are two ways to start a task:
according to the twitter api documentation http://dev.twitter.com/doc/get/statuses/user_timeline accessing the current logged in users timeline
According to the C++0x spec , the following is legal class A { A(int
According to Xeround's Release Notes they don't support save points and I can't figure
According to Steffen's post this is an efficient way to generate random BOOL s
According to Microsoft , you must sign your ClickOnce application. But it seems to
According to 8.2 The Null Type chapter of Ecma-262 null is type. But typeof(null)
According to Apple , I can combine UINavigationController and UITabBarController using the code, e.g.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.