Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default What's the equivalent way of "Cells" method for the C++(ATL)

As in VB's

MyWorksheet.Cells(2,3) = "Hello1"

If I wanna do this in VC++,
What's the equivalent way(using ATL).

More specifically,
I've downloaded the following code from a Web source.

.............
CoInitialize(NULL);

Excel::_ApplicationPtr excel;
HRESULT hr = excel.CreateInstance(L"Excel.Application");

Excel::_WorkbookPtr workbook =
excel-Workbooks-Add(static_cast<long(Excel::xlWorksheet));
Excel::_WorksheetPtr worksheet = excel-ActiveSheet;

worksheet-Range["A1"]-Value = "Hello1"; // Set a value

workbook-Close();
excel-Quit();
CoUninitialize();
........

In this source code,
How can I change this
worksheet-Range["A1"]-Value = "Hello1";
to the following way
worksheet-Cells ?

Thanks, In advance.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 473
Default What's the equivalent way of "Cells" method for the C++(ATL)

David K. Kim wrote:
In this source code,
How can I change this
worksheet-Range["A1"]-Value = "Hello1";
to the following way
worksheet-Cells ?

Thanks, In advance.


I guess nobody in this Excel newsgroup speaks C++ (including me).
But it would seem reasonable, by analogy, that

worksheet-Cells[2,3]-Value = "Hello1";

might work.

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup

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
COUNTIFS equivalent in Excel 2003 - both criteria have text, one has "wildcard" Courtney[_3_] Excel Worksheet Functions 3 April 20th 10 03:01 AM
Excel Equivalent of Access "Load" Event? LarryP Excel Discussion (Misc queries) 2 April 7th 10 08:44 PM
Creating the equivalent of a "hash code" for a workbook AMADHA Excel Discussion (Misc queries) 3 December 19th 07 09:04 AM
Is there an Excel 2003 equivalent to Word's "versions" function? Steve Excel Discussion (Misc queries) 0 March 4th 07 02:01 AM
Is there an equivalent of Lotus 123's "Paste visible" command? AJ Excel Discussion (Misc queries) 6 March 16th 06 09:21 AM


All times are GMT +1. The time now is 04:15 AM.

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"