Solved

Programmatically export query results to Excel

Posted on 2008-06-10
4
1,102 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 119

Accepted Solution

by:
Rey Obrero 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 119

Expert Comment

by:Rey Obrero
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

895 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now