Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
VBA Export Query to Excel
David Czerwinski 
    
4 years 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 OP  @Reply  
    
4 years 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
Richard Rost  @Reply  
           
4 years ago
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.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/6/2026 9:49:48 PM. PLT: 1s