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 8665821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:34:52+00:00 2026-06-12T17:34:52+00:00

I am trying to work with LibXL. I can extract data from sheets, but

  • 0

I am trying to work with LibXL. I can extract data from sheets, but need a function to transform a string with Excel row and column indices into startRow, endRow, startCol, endCol i.e.

“A1:B3” into startRow = 0, endRow = 2, startCol = 0, endCol = 1 (LibXL uses 0 based indexing)

I have tried everything I can think of. The library does not come with any examples that use this function and the documentation is quite sparse. What am I doing wrong?

Here is my code:

int main()
{
    const char range[] = "B2:C3";
    int i, ret, rowFirst=0, rowLast=0, colFirst=0, colLast=0;
    BookHandle book;
    SheetHandle sheet;

    book = xlCreateBook();

    ret = xlBookLoad(book, "/home/jason/Downloads/panel.xls");

    sheet = xlBookGetSheet(book, 0);

    ret = xlSheetGetNamedRange(sheet, &range[0], &rowFirst, &rowLast, &colFirst, &colLast);

    printf("ret from xlSheet...Range = %d\n", ret);

    printf("%s\n", xlBookErrorMessage(book));
    printf("rowLast = %d\n", rowLast);
    printf("rowLast = %d\n", rowLast);
    printf("colFirst = %d\n", colFirst);
    printf("colLast = %d\n", colLast);

    return 0;

}
  • 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-12T17:34:53+00:00Added an answer on June 12, 2026 at 5:34 pm

    use xlSheetAddrToRowCol() function for this purpose:

    int rowStart, colStart, rowEnd, colEnd;
    int rowRelativeStart, colRelativeStart, rowRelativeEnd, colRelativeEnd;
    
    xlSheetAddrToRowCol(sheet, "B2", &rowStart, &colStart, &rowRelativeStart, &colRelativeStart);
    xlSheetAddrToRowCol(sheet, "C3", &rowEnd, &colEnd, &rowRelativeEnd, &colRelativeEnd);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to work out why I can not access the nested function
Trying to work with groupby so that I can group together files that were
Im trying to work out how to get the value from one setting in
I am trying to scrap some content from a website but the code below
I'm trying work with time data regarding the duration of several experiments. That data
I am trying to read tags from XML using LibXML. I can print all
Trying to work with array, but it gives me Statement requires expression of integer
So I was trying to work this out but it seems that the last
I'm trying to work on an existing website and I've found a bug, but
I'm trying to work with mod_rewrite without particular problems but this: RewriteRule ^(product/)([^/\<\>].+?)(/)([^/\<\>].+?)(/edit)/?$ php/prd_edit.php

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.