Don't know if this helps you, but this is the VB code I wrote for one of my
programs to export to Excel (works with all versions of Excel). You should
be able to convert it to VBA.
' Begin Code
Dim Excel As Excel.Application ' This is the excel program
Dim ExcelWBk As Excel.Workbook ' This is the work book
Dim ExcelWS As Excel.Worksheet ' This is the sheet
Public Sub ExcelExport()
Set Excel = CreateObject("Excel.Application") ' Create Excel Object.
Set ExcelWBk = Excel.Workbooks.Add
Set ExcelWS = ExcelWBk.Worksheets(1)
Dim i As Integer
Dim row As Integer
Dim filename As String
filename = frmExport.txtFile.Text
row = 2
With frmsearchmp3.ListView1
'Add header
ExcelWS.Cells(1, 1) = "Artist/Band"
ExcelWS.Cells(1, 2) = "Title"
ExcelWS.Cells(1, 3) = "CD Code"
ExcelWS.Cells(1, 4) = "Path"
ExcelWS.Cells(1, 5) = "CD Serial"
For i = 1 To .ListItems.Count
ExcelWS.Cells(row, 1) = .ListItems(i).Text
ExcelWS.Cells(row, 2) = .ListItems(i).ListSubItems(1).Text
ExcelWS.Cells(row, 3) = .ListItems(i).ListSubItems(2).Text
ExcelWS.Cells(row, 4) = .ListItems(i).ListSubItems(3).Text
ExcelWS.Cells(row, 5) = .ListItems(i).ListSubItems(4).Text
DoEvents
row = row + 1
Next
ExcelWBk.SaveAs filename
End With
MsgBox "File Creation Complete", vbOKOnly + vbInformation, "MP3 Store"
ExcelWBk.Close
Excel.Quit
End Sub
'End Code
--
Regards
Steven Burn
Ur I.T. Mate Group CEO
www.it-mate.co.uk