467,136 Members | 1,286 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,136 developers. It's quick & easy.

How to access cells in an Excel Spreadsheet by row and column

I would like to set a particular cell in an Excel Spreadsheet to a specific
value

Visual Basic Equivalent would be

Cells(row, column) = x

where row and column locate the cell and x is the value

In C++, I can execute code such as

Excel::Range* range1 = worksheet->get_Range(S"G1", Missing:Value);

to obtain a range object which points ot G1 (row 1, column 7). However, I
cannot find an equivalent to access G1 by its row and column

I have tried get_Range(S"r1c7", Missing:Value) but this does not work.

worksheet->get_Cells() returns a range but does not take any parameters.

Any suggestuions?

Howard Weiss

Nov 17 '05 #1
  • viewed: 3885
Share:
1 Reply
The following works

Excel::Range* range1 = worksheet->get_Range(S"G1", Missing::Value);
Excel::Range* rangex = range1->get_Resize(S"5", S"5");
Excel::Range* rangey = rangex->get_Offset(S"2", S"2");

It is not obvios that get_Resize and get_Offset have the desired function

Howard

"Howard Weiss" <hp*****@comcast.net> wrote in message
news:eN**************@tk2msftngp13.phx.gbl...
I would like to set a particular cell in an Excel Spreadsheet to a specific value

Visual Basic Equivalent would be

Cells(row, column) = x

where row and column locate the cell and x is the value

In C++, I can execute code such as

Excel::Range* range1 = worksheet->get_Range(S"G1", Missing:Value);

to obtain a range object which points ot G1 (row 1, column 7). However, I
cannot find an equivalent to access G1 by its row and column

I have tried get_Range(S"r1c7", Missing:Value) but this does not work.

worksheet->get_Cells() returns a range but does not take any parameters.

Any suggestuions?

Howard Weiss

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Ronny Sigo | last post: by
4 posts views Thread by ctkevin | last post: by
1 post views Thread by smaczylo@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.