I want to program a button to export a query to excel and it works fine but overwrites the SS. I want to export to a template excel that has all my conditional formatting. this code works but overwrites DoCmd.OutputTo ObjectType:=acOutputQuery, ObjectName:="CertsMissingFullQ", OutputFormat:=acFormatXLSX, Outputfile:="C:\CertsDue.xlsx" I used code from a a YT video that makes a new worksheet but when I run it I get Unable to update table or object read only .
David Czerwinski 4 months ago
this code returns "database or object read only error" here is the code I used
Dim filepath As String
Dim sSheetName As String
sSheetName = InputBox("EnterWorkbook Sheet Name")
filepath = "D:\My Documents\Acuative Training Records\CertsMissingFullQtest.xlxs"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "CertsMissingFullQtest", filepath, True, sSheetName