CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2002
    Location
    Indonesia
    Posts
    109

    Excel Automation

    Hellow..
    Where can i get the documentation of Excel Automation Interface Method and Properties? The interface is pretty confusing. I've desperated looking in microsoft sites and msdn, none is exist.. anybody can help? i need to finish my project to convert excel sheet cells into bunch of sql statement to be executed in oracle. I've been able to prepare the workbooks etc, but confused with some methods and properties. thanks...
    Ing Ngarso sung Tuladha -> The Leader gives the lesson

  2. #2
    Join Date
    Nov 2002
    Location
    Indonesia
    Posts
    109

    Re: Excel Automation

    How can i parse the content of Range returned by _WorkSheet->UsedRange?
    Ing Ngarso sung Tuladha -> The Leader gives the lesson

  3. #3
    Join Date
    Nov 2002
    Location
    Indonesia
    Posts
    109

    Re: Excel Automation

    Hi.. It's me again.. still with some desperation..
    How to select cell not by it's name but by it's index?
    For example A1 is index 1,1 and A2 is index 1,2, etc.
    Does the Excel::_Worksheet::GetUsedRange() function has a bug or something? coz i have 2 row and 5 column (2x5) of data. I call the function at the first time, it returns 2x5 range (which is correct). Then i expand/add the data to became 5x5, the function returns 5x5 size (which is.. still.. correct). But when i contract the data size into 3x5 or 4x5 and i recall the function, it still return 5x5. Does the function has a bug, or it's intended to do so..?
    So how can i get the valid range that contains the real data?
    Thanks..
    Ing Ngarso sung Tuladha -> The Leader gives the lesson

  4. #4
    Join Date
    May 2005
    Posts
    4,954

  5. #5
    Join Date
    Jun 2005
    Posts
    1,255

    Re: Excel Automation

    As you see, GetUsedRange (or UsedRange.Rows.Count) is returning the maximum size a range has ever had. This is not specific to automation. You have the same phenomenom with Excel VBA.

    A workaround in Excel VBA (sorry I don't know its equivalent in automation) is using ...End(xlDown) or ..End(xlUp).

  6. #6
    Join Date
    Nov 2002
    Location
    Indonesia
    Posts
    109

    Re: Excel Automation

    Holly god..
    It works well. I Used RangePtr->End(xlDown) & RangePTr->End(xlToRight), I can get the valid used range. Thanks, ur great
    Ing Ngarso sung Tuladha -> The Leader gives the lesson

  7. #7
    Join Date
    Nov 2002
    Location
    Indonesia
    Posts
    109

    Re: Excel Automation

    Now.. how can i get the active/selected cells? There are active sheets, active table, but no active cells or selected cells.
    Ing Ngarso sung Tuladha -> The Leader gives the lesson

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured