How To Have Access Export A Table To An Excel XLSX In VBA

This was regarding a question I received from this blog:

Hello, I am hoping to find some help. I have an Access DB that I use
to collect data. I have a number of different reporting features. I
would like to add the option for my user to export to excel. When I do
this with a DoCMD code that data exports but now I would like the
ability to format the spreadsheet on export. Is this something that I
can find help with here?

So it sounds like you want to export a table from access to excel?

Well in this post, I’m going to show you.

In this post we are going to avoid Excel reference complaints by using late binding.

First we’ll have a button which will call our export to Excel function, where we can put any parameters we need:

This data comes from the Northwind database’s “Customer” table. Click here to download.

Here is the code, commented to provide instruction:

Here is the end result:

#access-vba-export-table-to-excel-xlsx

Let me know if you have questions.

Free! Subscribe To Our YouTube Channel!

facebooktwittergoogle_plusredditpinterestlinkedinmailby feather
Tags: , ,




 

Call Erik Now