Closed Thread
Results 1 to 6 of 6

finding the cell number using C++

  1. #1
    Registered User
    Join Date
    09-28-2009
    Location
    Indiana
    MS-Off Ver
    Excel 2003
    Posts
    2

    Smile finding the cell number using C++

    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.
    Please Login or Register  to view this content.
    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

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: finding the cell number using C++

    This is an Excel VBA Forum, not C++. You might have to wait for someone who can help.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    09-28-2009
    Location
    Indiana
    MS-Off Ver
    Excel 2003
    Posts
    2

    Smile Re: finding the cell number using C++

    @royUK: Can I atleast get the syntax of VB so that I will try to get a correct syntax in C++.

    Thanks

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: finding the cell number using C++

    What does your code return?

  5. #5
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: finding the cell number using C++

    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.
    Remember what the dormouse said
    Feed your head

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: finding the cell number using C++

    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!

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1