Export multiple queries via Macro

Access Beginner

Active Member
Joined
Nov 8, 2010
Messages
311
Office Version
  1. 2016
Platform
  1. Windows
Hi guys,

I have 15 queries which I have to export to excel. I have gone to the Macro section in Access and used the "OutputTo" action. But from my limited understanding the Excel file that you export to must already exist in the directory your are importing to.

My intention is to create 15 Macros to export each query (these are 15 different Area queries), and then create another macro( called for example Area Exports),to run the above 15 Area Macros but the message of "file already exists" will pop up. I want to be able to run the Area Exports macro and not have the file already exists message show and then having to hit OK for each instance.

Is this possible?

Cheers
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Hi guys,

I have 15 queries which I have to export to excel. I have gone to the Macro section in Access and used the "OutputTo" action. But from my limited understanding the Excel file that you export to must already exist in the directory your are importing to.

My intention is to create 15 Macros to export each query (these are 15 different Area queries), and then create another macro( called for example Area Exports),to run the above 15 Area Macros but the message of "file already exists" will pop up. I want to be able to run the Area Exports macro and not have the file already exists message show and then having to hit OK for each instance.

Is this possible?


Cheers

Sorry forgot to mention I am using Access 2007
 
Upvote 0
If you hit OK, I assume that the export then runs.
You can avoid the warnings by putting SetWarnings (No) step before the exports, then SetWarnings (Yes) once finished.

Denis
 
Upvote 0

Forum statistics

Threads
1,224,504
Messages
6,179,142
Members
452,892
Latest member
JUSTOUTOFMYREACH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top