Private Sub cmdPrintChecks_Click()
Dim ExcelApp As Excel.Application
Dim ExcelWorkbook As Excel.Workbook
Dim ExcelSheet As Excel.Worksheet
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim sPath As String
Dim i As Integer
Set ExcelApp = CreateObject("Excel.Application")
Set ExcelWorkbook = ExcelApp.Workbooks.Add
Set db = CurrentDb
Set rs = db.OpenRecordset("tmpCheckQueue")
sPath = "C:\Checks"
rs.MoveFirst
i = 1
Do Until rs.EOF
Set ExcelSheet = ExcelWorkbook.Worksheets(i)
rs.MoveNext
i = i + 1
Loop
rs.Close
Set rs = Nothing
Set db = Nothing
Set ExcelApp = Nothing
Set ExcelWorkbook = Nothing
Set ExcelSheet = Nothing
End Sub
Dim ExcelApp As Excel.Application
Dim ExcelWorkbook As Excel.Workbook
Dim ExcelSheet As Excel.Worksheet
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim sPath As String
Dim i As Integer
Set ExcelApp = CreateObject("Excel.Application")
Set ExcelWorkbook = ExcelApp.Workbooks.Add
Set db = CurrentDb
Set rs = db.OpenRecordset("tmpCheckQueue")
sPath = "C:\Checks"
rs.MoveFirst
i = 1
Do Until rs.EOF
Set ExcelSheet = ExcelWorkbook.Worksheets(i)
rs.MoveNext
i = i + 1
Loop
rs.Close
Set rs = Nothing
Set db = Nothing
Set ExcelApp = Nothing
Set ExcelWorkbook = Nothing
Set ExcelSheet = Nothing
End Sub