VB 6.0 - How to use MS Excel as Back end in VB6

Asked By Ralph Acido on 20-Sep-05 09:34 PM
Im a beginner programmer in VB6. I have an Excel file i want to retrieve records from this file and display it in any controls in VB 6.0.. I know how to connect to MS Excel using System DSN but i dont know how to retrieve records from it. Any help?
Thank you..

see this - Asked By Venkat K on 21-Sep-05 06:40 AM

if you already connected to excel it is an example to get the values frm excel from the specified cells

Sub test()
    GetValuesFromAClosedWorkbook "C:", "Book1.xls", _
            "Sheet1", "A1:K30"
End Sub

Sub GetValuesFromAClosedWorkbook(fPath As String, _
            fName As String, sName, cellRange As String)
    With ActiveSheet.Range(cellRange)
        .FormulaArray = "='" & fPath & "\[" & fName & "]" _
                    & sName & "'!" & cellRange
        .Value = .Value
    End With
End Sub

Here is a link - Asked By Aarthi Saravanakumar on 21-Sep-05 07:08 AM


Thank you guys - Asked By Ralph Acido on 27-Sep-05 08:56 PM

Thank you very much guys Your suggestions works well...