Solved

Programmatically export query results to Excel

Posted on 2008-06-10
4
1,118 Views
Last Modified: 2012-06-27
I'm trying to figure out how to programmatically export data from Access to Excel, create a chart in Excel and then copy that to Word.  I've been performing this operation manually and It's no big deal, but the users want to be able to push a button.  Here's the scenario:
At month end, five chart reports are generated from a large Access customer service database.  Upper management wants to copy and paste these charts to their PDAs from Word.  I haven't been able to copy Access charts to Excel or Word.  So, I run the Access queries, copy the results table to Excel, generate an Excel chart and copy that chart to Word.  I'm sure this process could be automated, but I haven't a clue where to start.
Any ideas?  Anybody done anything like this before or seen it done?
Thanks!
0
Comment
Question by:NaughtyZute
  • 2
  • 2
4 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 21751233
to export data to excel

   docmd.transferSpreadsheet acexport, acSpreadsheetTypeExcel9, _
        "QueryNameOrTablename", "c:\myExcel.xls", true, "nameOfSheet"
0
 

Author Comment

by:NaughtyZute
ID: 21769493
Thanks for the speedy reply Capricorn and I apologize for my tardy response.  As happens daily in software development, I've gotten pulled off this non-critical project to other things.  I'll try your suggestion as soon as I get a little tiime.  By what you've said then, I'll need to save the spreadsheet and then need a separate macro in Excel to generate the chart?  The user would actually be ok with pasting the charts into Word on his own.  Anyway, thanks again.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 21909797
why a grade of B?
0
 

Author Comment

by:NaughtyZute
ID: 21912665
I'm sorry capricorn.  I guess because you only provided me with step 1 and because I never got to try the solution or take the thing any farther.  I guess I should have done an A.  But there was a long way to go to the Excel Chart, Word Doc. etc.  Didn't mean to offend you.  Your answer was right on.  I'll change the grade if I can figure out how.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

856 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