VBA Export Query to ExcelUpload ImagesLink David Czerwinski 5 months ago
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 5 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
You probably don't have permission to write to your C:\ root folder. Common Windows issue unless you're logged on as Administrator or elevate the instance of Access.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.