-
September 28th, 2009, 02:08 PM
#1
Excel programing in C++
Hi,
After struggling a little bit, now I am able to write a program to access excel spreadsheets using MFC in VS2005. I am able to create the wrapper and able to access excel files, write data into it by specifying a cell number manually.
Also I can search for data in a given range by using Range.Find() function.
Code:
#define vOpt COleVariant((long) DISP_E_PARAMNOTFOUND, VT_ERROR)
..
..
Range range;
..
..
if(range.Find(COleVariant("09/28"), vOpt, vOpt, vOpt, vOpt, (long) 1, vOpt, vOpt))
{
...
}
Can someone please tell me how to get the cell number of that specific cell where the data is located.
Also is there any good tutorial or help file where I can refer to for further questions.
Thanks in advance
-
Gary
-
September 28th, 2009, 04:42 PM
#2
Re: Excel programing in C++
1. No, there is not any really good documentation.
2. The usual way is:
- open Excel
- record a macro with the actions you want to do
- analyze the recorded VBA code and look for a similar functions among generated excel automation classes
Victor Nijegorodov
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|