Private Sub Form_Click() Dim excelApp As Excel.Application Set excelApp = New Excel.Application
If excelApp Is Nothing Then Set excelApp = CreateObject("Excel.application") If excelApp Is Nothing Then Exit Sub End If End If excelApp.Visible = True Me.MousePointer = vbHourglass excelApp.Workbooks.Add ‘Cells(1, 1)为筛的坐标(行,列) ’ Text1.Text 文本内容 excelApp.ActiveSheet.Cells(1, 1).Value = Text1.Text Me.MousePointer = vbDefault Set excelApp = NothingEnd Sub
Private Sub Form_Click()
Dim excelApp As Excel.Application
Set excelApp = New Excel.Application
If excelApp Is Nothing Then
Set excelApp = CreateObject("Excel.application")
If excelApp Is Nothing Then
Exit Sub
End If
End If
excelApp.Visible = True
Me.MousePointer = vbHourglass
excelApp.Workbooks.Add
‘Cells(1, 1)为筛的坐标(行,列)
’ Text1.Text 文本内容
excelApp.ActiveSheet.Cells(1, 1).Value = Text1.Text Me.MousePointer = vbDefault
Set excelApp = NothingEnd Sub