If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
Macro or VB code to Export data to an Excel file?
You can use the Transfer Spreadsheet function on your query. The button code
would be something like: Private Sub MyButton_Click() DoCmd.TransferSpreadsheet acExport, _ acSpreadsheetTypeExcel9, "QueryName", _ "C:\Test.xls",, "MyName" End Sub Just for your information, acSpreadsheetTypeExcel9 is Excel 97 which should be readable by later versions, but you can also export to a later format. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "BobC" wrote in message ... I have a query that assembles the data that I would like to routinely export as an Excel file to a specific file location. I would like it such that various users can 'just press a button' so to speak and get the most current data from the database for use in an Excel Pivot Table. I would like either or both a Macro or VB code to do this. When I looked at the Macro options this was not obvious? Bob |
#12
|
|||
|
|||
Macro or VB code to Export data to an Excel file?
Thanks! You guys/gals are doing us folks a lot of good!
Arvin Meyer [MVP] wrote: Steve Santus basically haunts these newsgroups looking for business. He was caught by the poster who answered him. Good professional quality help is here for free. |
#13
|
|||
|
|||
Macro or VB code to Export data to an Excel file?
Thanks John!
You have helped me more than once (without making look totally stupid) and I appreciate it. I write, or try to write code only when I need to. That give me plenty of time to forget before I need help again! As I said (above), you and several others do a lot of good helping out! THANKS MUCH! Bob John W. Vinson wrote: On Tue, 29 Dec 2009 19:45:13 -0500, wrote: I suspect I am mission out on something here? Steve is notorious for using these groups to troll for unsuspecting potential customers. Unlike 99+% of the other volunteers who answer here, he considers it appropriate to solicit paid business. John (and a few other people) post responses to these solicitations to warn folks that Steve's proposals should be carefully examined. |
#14
|
|||
|
|||
Macro or VB code to Export data to an Excel file?
This is certainly scary!
It worked the first time! Thank You Very Much!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Bob Arvin Meyer [MVP] wrote: You can use the Transfer Spreadsheet function on your query. The button code would be something like: Private Sub MyButton_Click() DoCmd.TransferSpreadsheet acExport, _ acSpreadsheetTypeExcel9, "QueryName", _ "C:\Test.xls",, "MyName" End Sub Just for your information, acSpreadsheetTypeExcel9 is Excel 97 which should be readable by later versions, but you can also export to a later format. |
|
Thread Tools | |
Display Modes | |
|
|