Dear All,
I'm creating new workbook and worksheet through ACCESS VBA (MS Access 2007). After creating new worksheet I'm extracting data from ACCESS and writing into the sheet.
After that I'm creating new sheet and trying to transfer ACCESS query resultset to new created sheet. I'm stuck over here. Cause I have not saved workbook and I need "Full Name of Excel WorkBook" for TransferSpreadsheet. Any idea how to achieve this using TransferSpreadsheet and without saving and opening the file again.
DoCmd.TransferSpreadsheet {Direction of Transfer}, _
{SpreadSheet Type}, {Query to Select Data}, _
{Full Name of Excel WorkBook, True, {Name of WorkSheet}
I'm creating new workbook and worksheet through ACCESS VBA (MS Access 2007). After creating new worksheet I'm extracting data from ACCESS and writing into the sheet.
After that I'm creating new sheet and trying to transfer ACCESS query resultset to new created sheet. I'm stuck over here. Cause I have not saved workbook and I need "Full Name of Excel WorkBook" for TransferSpreadsheet. Any idea how to achieve this using TransferSpreadsheet and without saving and opening the file again.
DoCmd.TransferSpreadsheet {Direction of Transfer}, _
{SpreadSheet Type}, {Query to Select Data}, _
{Full Name of Excel WorkBook, True, {Name of WorkSheet}
Code:
.DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, strTempQueryName, sWorkbookPath, True, sWorksheetName