发布网友 发布时间:2022-04-23 23:16
共2个回答
热心网友 时间:2023-10-13 08:40
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
热心网友 时间:2023-10-13 08:40
以前做过,不过现在忘了,你说的这个实现起来很简单,只要看看vba的知识就行了。