4、alse'不进行安全提示'xlBook.Close(False)'关闭工作簿Setxlsheet=NothingSetxlBook=NothingxlApp.QuitSetxlApp=NothingEndSub下面的代码就也能导出到EXCELDim xlApp As Excel.ApplicationDim xlBook As Excel.WorkbookDim xlSheet As Excel.WorksheetDim i As Long, J As LongOn Error GoTo ErrorHandleSet xlA
5、pp = CreateObject("Excel.Application")Set xlBook = xlApp.Workbooks.AddSet xlSheet = xlBook.Worksheets(1) For i = 0 To MHFGrid.Rows - 1 For J = 0 To MHFGrid.Cols - 1 xlSheet.Cells(i + 1, J + 1).Value = MHFGrid.TextMatrix(i, J) Next J N
6、ext i xlSheet.Application.Visible = True Set xlSheet = Nothing Set xlBook = Nothing Set xlApp = Nothing Exit SubErrorHandle:MsgBox "错误:" & Err.Number & vbCrLf & Err.Description, vbOKOnly, "运行错误"如何将表中的数据导出到电子表格中作者:施进兵有很多方法都可将数据库中某个表的数据导出到电子表格中,例如通过创建A