Results 1 to 4 of 4

Thread: How to read data from excel

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2000
    Location
    Singapore
    Posts
    59

    Question

    Hai,
    Any one know how to read data from an excel sheet from vb.


    Thanks
    Karun
    With regards,
    Karun

  2. #2
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    London
    Posts
    290

    just a guess...

    ...but when i was reading about ADO, MS made a big deal about being able to read from different data sources. They gave Emails as an example, and seeing that spreadsheets must be more of a structured format than most emails, i imagine its possible.
    Maybe worth searching microsofts site for "ADO excel" or something?

  3. #3
    Junior Member
    Join Date
    Oct 2000
    Posts
    18
    Add MS Excel Object Library to your Project References.
    Code:
    Workbooks.Open FileName:="C:\YourFile.xls"
    Workbooks.Application.Visible = True  'False to hide Excel from the user
    
    SomeValue = Range("A1").Text
    SomeOtherValue = Range("B1").Text
    
    Workbooks.Application.Quit
    Workbooks.Application.DisplayAlerts = False
    Hope this helps!

  4. #4
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    If it is Tabular, you can also use the data control.
    Chemically Formulated As:
    Dr. Nitro

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