Function tired_of_name_test() Dim oExcel As Excel.Application ' Excel Application Set oExcel = New Excel.Application ' Start it oExcel.Workbooks.Open "YOUR_EXCEL_FILE.XLSX" ' **** CHANGE NAME HERE **** Open it. on error goto kill_task Col = ListBox1.ColumnCount ' Number of Columns Row = ListBox1.ListCount ' Number of Rows For C = 1 to Ubound(Col) ' For each Column For L = 1 to Ubound(Row) ' in Each Line oExcel.Cells(j,i) = Listbox1.List(j - 1, i - 1) ' Write the value for Line, Columns next L ' Next Line next C ' Next Col oExcel.ActiveWorkbook.Save ' Save oExcel.Workbooks(1).Close ' Close Workbook oExcel.Application.Quit ' Close Application exit function kill_task: oExcel.ActiveWorkbook.Save ' Save oExcel.Workbooks(1).Close ' Close Workbook oExcel.Application.Quit ' Close Application end function
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)