Private Sub Form_Click()
Dim excelApp As Excel.Application
Set excelApp = New Excel.Application
On Error Resume Next
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
With excelApp.ActiveSheet
Dim i As Integer, j As Integer
For i = 1 To 5
For j = 1 To 5
.Cells(i, j).Value = "l"
Next j
DoEvents
Next i
End With
excelApp.ActiveSheet.Cells(1, 2).ColumnWidth = 16
Me.MousePointer = vbDefault
Set excelApp = Nothing