CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2005
    Posts
    57

    Most speedy way of reading data from excel

    What is the most speedy way of reading data from excel ?
    Is it possible to get data, formatting, etc... from a xls file without opening Excel?
    Thanks...

  2. #2
    Join Date
    Dec 2004
    Posts
    423

    Re: Most speedy way of reading data from excel

    The only way I know how to get data from excel with vb is to open excel and retreive data. I would think that it would be possible to read the file without opening and I would like to know how to do that too.

  3. #3
    Join Date
    Jul 2005
    Posts
    57

    Re: Most speedy way of reading data from excel

    Once I downloaded a code which was getting excel data without opening excel, but it was'nt getting formatting, and if the first row was empty, it was returning null for the file, anyone has any ideas?

  4. #4
    Join Date
    Nov 2002
    Location
    Baby Land
    Posts
    646

    Re: Most speedy way of reading data from excel

    You can use ADO to read excel file, look for the connection string needed by ADO here

  5. #5
    Join Date
    Jun 2005
    Location
    gandhinagar,gujarat
    Posts
    51

    Thumbs up Re: Most speedy way of reading data from excel

    put a DATA1 control on form
    set the property of DATA1 as shown below either design time or run time

    data1.connect="Excel 5.0"
    data1.recordsource=" filename with path"
    data1.recordsource="xyz$"..............where 'xyz' is sheet name..

    use of following string woluld give the data range of coloum 'x'
    data1.recordset.fileds(x).............'0 for column1(A), 1 for column2(B)...and so on...

  6. #6
    Join Date
    Jul 2005
    Posts
    57

    Re: Most speedy way of reading data from excel

    Does it work if we don't know the sheet name? I mean, if I want to read from the first sheet of the file..
    Last edited by tanerpro; August 3rd, 2005 at 11:22 AM.

  7. #7
    Join Date
    Jun 2005
    Location
    gandhinagar,gujarat
    Posts
    51

    Re: Most speedy way of reading data from excel

    i do not know how to call first excel sheet .but what is the use if we do not know the sheet or table name
    ******** what exactly you want to do.

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