Hi Bob,
Using the code you gave me, I can export one query to one excel spreadsheet.
I need to do this on several different queries/spreadsheets, but all independantly.
I have tried just copying the code again, and then setting up a new call, but this does not work.
Any ideas on how I can do this?
Many thanks.
For each Query/Spreadsheet combination you need to execute a new call statement with the varying data. As Bob said, the function is a generic one that you pass parameters to. So each time you call the function (which you only need one of) you pass it a different
set of parameters so it works with a different query.
Hope this helps, Scott<> P.S. Please post a response to let us know whether our answer helped or not. Microsoft Access MVP 2010 Blog: http://scottgem.wordpress.com Author: Microsoft Office Access 2007 VBA Technical Editor for: Special Edition Using Microsoft
Access 2007 and Access 2007 Forms, Reports and Queries