Private Sub Command1_Click() Dim xlExcel As Excel.Application Dim xlBook As Excel.Workbook Dim xlSheet As Excel.Worksheet Dim AppExcel As Object Dim str As String str = App.Path & "\11.xls"
Set objExcel = CreateObject("Excel.Application") objExcel.Visible = False '设置excel对象不可见 Dim objWorkBook As Excel.Workbook objExcel.SheetsInNewWorkbook = 1 Set objWorkBook = objExcel.Workbooks.Add objExcel.Cells(3,4) = Text1.Text objWorkBook.SaveAs str objWorkBook.Close (True) objExcel.Quit Set objExcel = Nothing End Sub