Private Sub 导出_Click()
Dim xlApp As New Excel.Application
Dim xlBook As Excel.Workbook
Dim i As Long, j As Long
If Right(Me.文件.Value, 3) <> "xls" Then Exit Sub
xlApp.Application.Visible = True
Set xlBook = xlApp.Workbooks.Open(Me.文件.Value)
xlBook.Application.Sheets(1).Select
xlBook.Application.Cells.Select
xlBook.Application.Selection.ClearContents
xlBook.Application.Cells(1, 1).Select
For i = 0 To Me.LIST.ColumnCount - 1
xlBook.Application.Cells(1, i + 1) = Me.LIST.Column(i, 0)
Next
For i = 1 To Me.LIST.ListCount - 1
For j = 0 To Me.LIST.ColumnCount - 1
xlBook.Application.Cells(i + 1, j + 1) = Me.LIST.Column(j, i)
Next
Next
xlBook.Save
Set xlApp = Nothing
Set xlBook = Nothing
End Sub