Solved

Programmatically export query results to Excel

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

758 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

23 Experts available now in Live!

Get 1:1 Help Now