Hi there,
I want to run this with a touch of a button in Access. I believe I need to create a function then a macro to run that function. I am new to VBA so I am learning as I go. The code works as I need it to. I just want to push a button and the export happens. Right now I am having to hit run on the VBA tool bar to get it run.
Can someone help me out?
Sub Export2Queries()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "CB SP Approval Query", "T:\Collections\Refunds\Weekly auto refund report\Disbursment\Approval TemplateV2.xlsx", True
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Resi Corp SP Approval Query", "T:\Collections\Refunds\Weekly auto refund report\Disbursment\Approval TemplateV2.xlsx", True
End Sub
I want to run this with a touch of a button in Access. I believe I need to create a function then a macro to run that function. I am new to VBA so I am learning as I go. The code works as I need it to. I just want to push a button and the export happens. Right now I am having to hit run on the VBA tool bar to get it run.
Can someone help me out?
Sub Export2Queries()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "CB SP Approval Query", "T:\Collections\Refunds\Weekly auto refund report\Disbursment\Approval TemplateV2.xlsx", True
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Resi Corp SP Approval Query", "T:\Collections\Refunds\Weekly auto refund report\Disbursment\Approval TemplateV2.xlsx", True
End Sub