+ Reply to Thread
Results 1 to 2 of 2

Reading complete Excel using DDE code

  1. #1
    Registered User
    Join Date
    08-16-2005
    Posts
    1

    Reading complete Excel using DDE code

    Hello All,

    I am able to sucessfully read contents of excel file using DDE command with parameter R1C1:R10C10 i.e. by giving the start and end number of columns and rows.

    What if I dont know the start and the end number and I want to read the entire document in one go.

    Is there a command to read the complete Content of a single sheet from a excel file in one go ?

    I am aware that I could iterate through the rows and columns untill I stop getting more data but in this particular case it is impractical as the excel sheet is too large and take about 30 mins to iterate through it.

    Thanks for your help in advance.
    -Amit

  2. #2
    okaizawa
    Guest

    Re: Reading complete Excel using DDE code

    Hi,

    you can select cell range by using excel4 macro function in DDE.
    the following is an example for word 2000 vba:

    Sub DDE_Test()
    Dim ch As Integer, ch2 As Integer
    Dim Sel As Variant, Ret As Variant

    ch = DDEInitiate("Excel", "System")
    DDEExecute ch, "[FORMULA.GOTO(""[Book1.xls]Sheet1!R1C1"")]"
    DDEExecute ch, "[SELECT.SPECIAL(5)]" 'select a current region
    Sel = DDERequest(ch, "Selection")
    Sel = Split(Sel, "!")
    DDETerminate ch

    ch2 = DDEInitiate("Excel", Sel(0))
    Ret = DDERequest(ch2, Sel(1))
    'Selection.InsertAfter Ret
    DDETerminate ch2
    End Sub


    the reference on macro function is here:

    http://www.microsoft.com/downloads/d...0-5d03748ca5cd
    http://support.microsoft.com/kb/143466/EN-US/

    --
    HTH,

    okaizawa



    amitkrsingh wrote:
    > Hello All,
    >
    > I am able to sucessfully read contents of excel file using DDE command
    > with parameter R1C1:R10C10 i.e. by giving the start and end number of
    > columns and rows.
    >
    > What if I dont know the start and the end number and I want to read the
    > entire document in one go.
    >
    > Is there a command to read the complete Content of a single sheet from
    > a excel file in one go ?
    >
    > I am aware that I could iterate through the rows and columns untill I
    > stop getting more data but in this particular case it is impractical as
    > the excel sheet is too large and take about 30 mins to iterate through
    > it.
    >
    > Thanks for your help in advance.
    > -Amit
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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