By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,554 Members | 1,146 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,554 IT Pros & Developers. It's quick & easy.

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

P: 1
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
Share this Question
Share on Google+
1 Reply


100+
P: 1,646
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.