Question: how to export data from sql server to excel using vb6?
Answer: Dim oXLApp as Object 'Declare the object variables.
Dim oXLBook as Object.
Dim oXLSheet as Object.
Set oXLApp = CreateObject("Excel. Application") 'Create a new instance of Excel.
If Dir(sFileName) = "" Then.
Set oXLBook = oXLApp. Workbooks. ... 
Else.
Set oXLBook = oXLApp. Workbooks.