Dim xlApp
As Object
Dim xlWbk
As Object
Dim xlWsh
As Object
Dim Rng
As Object
Dim rsNum
As Integer
Dim rst
As New ADODB.Recordset
Dim i
As Integer
Dim cnn
As Object
Set rst = CreateObject(
"adodb.recordset")
Set cnn = CurrentProject.Connection
rst.CursorLocation =
3
rst.Open strExcel, cnn,
1,
1
Set xlApp = GetObject(,
"Excel.Application")
xlApp.Visible =
True
Set xlWbk = xlApp.Workbooks.Add
Set xlWsh = xlWbk.Worksheets(
1)
xlWsh.Activate
Create:
If Err =
429 Then
Set xlApp = CreateObject(
"Excel.Application")
Resume Next
End If