Question Locked

Retrieving data from excel using VB6

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,
I am new to vb6.I have just started programming in vb6. Can you please tell me in detail as to how can i retrive data from an excel spread sheet using vb6.

Thanks,
manoj

2 replies

by kansatheesh

Dim ExcelApp As Excel.Application
Dim WS As Excel.Worksheet
Dim i As Integer
Dim stra As String

Set ExcelApp = CreateObject("excel.application")
ExcelApp.Workbooks.Open ("C:\txtExce")'pathname Set WS = ExcelApp.ActiveWorkbook.Sheets(1)

Dim myVal, myval1 As Variant
myVal = WS.Range("a2").Value
Debug.Print (IsArray(myVal))
Text1.Text = myVal
'MsgBox "Value is: " & myVal
myval1 = WS.Range("b2").Value
Text2.Text = myval1
ExcelApp.Quit
Set WS = Nothing
Set ExcelApp = Nothing

This discussion is closed to new replies.