Hi,
I am new to this forum and this is my first post.
I am writing 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.
Can someone please tell me how to get the cell number of that specific cell where the data is located.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)) { ... }
Also is there any good tutorial or help file where I can refer to for further questions.
Thanks in advance
-
Gary
This is an Excel VBA Forum, not C++. You might have to wait for someone who can help.
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
Check out the free Excel Toolbar
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Code Tags: Make your code easier for us to read
@royUK: Can I atleast get the syntax of VB so that I will try to get a correct syntax in C++.
Thanks
What does your code return?
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
Check out the free Excel Toolbar
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Code Tags: Make your code easier for us to read
In VB, Range.Find returns a Range object (or Nothing if the data is not found) but I suspect in C++ it returns something like an IDispatch? If so, you should be able to use a range variable and AttachDispatch to get a reference to the found range (but I am way out of my comfort zone with C++!!)
Cross-posted here BTW.
So long, and thanks for all the fish.
Well spotted RomperStomper.
Your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us help you!
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
Check out the free Excel Toolbar
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Code Tags: Make your code easier for us to read
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks