I am creating an excel sheet using the Transfersheet function but I would also like to create an additional worksheet within that spreadsheet and populate it with the contents of My_tbl as follows:
Not sure if this is correct format to add the new worksheet:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, strFileName ", True, "New Sheet"
Also, how can I set the contents of my objXLSheet to populate the new worksheet that
I create within the spreadsheet created by the TransferSheet function?
thanks
Set rs = db.OpenRecordset("My_tbl")
With objXLSheet
Do
.Columns("A:B").HorizontalAlignment = xlCenter
.Cells(intLoop, 1) = rs!Month
.Cells(intLoop, 2) = rs![Pass Qty]
.Cells(intLoop, 3) = rs![Fail Qty]
.Cells(intLoop, 4) = rs![FPY Avg]
.Cells(intLoop, 4).NumberFormat = "0"
intLoop = intLoop + 1
rs.MoveNext
Loop Until rs.EOF
End With
Not sure if this is correct format to add the new worksheet:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, strFileName ", True, "New Sheet"
Also, how can I set the contents of my objXLSheet to populate the new worksheet that
I create within the spreadsheet created by the TransferSheet function?
thanks