?
Solved

Export a table to Excel (VBA)

Posted on 2010-01-05
2
Medium Priority
?
630 Views
Last Modified: 2013-11-27
I want to do one simple thing.

Push a button and export "MyTable" to Excel.

To make things easy, save in my documents folder.
File name will be provided on form text box.
0
Comment
Question by:phileoca
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 1000 total points
ID: 26185674
Dim strDir
strDir = Environ("userprofile") & "\My Documents\"

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Mytable", strDir & Me.textboxName, True
0
 
LVL 11

Author Closing Comment

by:phileoca
ID: 31673213
I knew there was a quick and easy solution to this.

Always a pleasure!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question