Re: How to save data in vb6
Working with an Excel file is very different to working with a text file, so the code is more complicated. It is still understandable tho!
If you have Excel installed on the computer the program will be running on, the easiest method for what you want will probably be using automation - see the Excel Tutorial link in my signature for explanations and examples (post here if you have problems getting it working).
Re: How to save data in vb6
VB Code:
Dim xBook as string
Dim xApp As Object
Set xApp = CreateObject("Excel.Application")
'xBook holds the name of the new Excel book created.
xBook = xApp.Workbooks.Add.Name
'References cell D5 in the workbook and puts it equal to the first line of the list box.
xApp.Workbooks(xBook).Sheets("Sheet1").Cells(5, 4) = lstOutput.List(0)
That is just the basic syntax. If you are not familiar with VBA, just record a macro in excel to help you out.