467,926 Members | 1,521 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,926 developers. It's quick & easy.

Retrieve a column's data from an Existing Excel Sheet through VB Code

Hi All !!!
Can anybody help me out,
how to retrieve a desired column's data from an existing excel sheet through the vb code.......

Dim strData As String
Dim ts As TextStream
Dim fso As New FileSystemObject
'Open text file
Set ts = fso.OpenTextFile(StrXLPath, ForReading)
Do While Not ts.AtEndOfStream
strData = ts.ReadLine
Loop
Nov 13 '06 #1
  • viewed: 1678
Share:
1 Reply
1GB
Hi All !!!
Can anybody help me out,
how to retrieve a desired column's data from an existing excel sheet through the vb code.......

Dim strData As String
Dim ts As TextStream
Dim fso As New FileSystemObject
'Open text file
Set ts = fso.OpenTextFile(StrXLPath, ForReading)
Do While Not ts.AtEndOfStream
strData = ts.ReadLine
Loop
Hi. You need to include a reference to MS Excel objects in your project. Then you can reference an excel worksheet and cells to obtain the data you need through automation rather than a file stream.

If you google visual basic excel automation you will get more than 2 million pages of info. Happy reading :)
Nov 13 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Steven Stewart | last post: by
7 posts views Thread by Vanessa | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.