How to schedule auto-exporting MS Access query to Excel and email it? (1 Viewer)

dchen

New member
Local time
Today, 15:27
Joined
Oct 9, 2014
Messages
2
I know Access can setup an Outlook Task to auto-export query to Excel, but it requires the Outlook to be always open on the user's computer.

Is there an easy way to setup a schedule that can automatically export a query to Excel and this schedule will then auto-email the exported Excel file to an email address every Monday at 5AM for example?

If this can only be done in VBA, any reference I may start with?

Thanks.
 

john_gringo

Registered User.
Local time
Tomorrow, 01:27
Joined
Nov 1, 2011
Messages
87
Find anything yet.....i have some code to share with you but I am not a pro.....just find a way to auto send mail for my soho....:)
 

Minty

AWF VIP
Local time
Today, 23:27
Joined
Jul 26, 2013
Messages
10,371
You would still need Access running on somebody's computer...

If this is connected to MS-SQL server backend you can use a scheduled stored procedure and SQL DB Mail to easily automate this.
 

dchen

New member
Local time
Today, 15:27
Joined
Oct 9, 2014
Messages
2
You would still need Access running on somebody's computer...

If this is connected to MS-SQL server backend you can use a scheduled stored procedure and SQL DB Mail to easily automate this.

The query syntax in MS Access is a bit different than MS SQL.
I found out that another way is to build a batch program to run the sqlcmd and put it into the Windows Scheduler. Would this way be better? Then the MS Access doesn't have to be always running in the background.
 

Minty

AWF VIP
Local time
Today, 23:27
Joined
Jul 26, 2013
Messages
10,371
Google for sending query results in email from MS SQL Server, you can completely automate it on the server - no need for any windows machine to be running, assuming your data is stored in a SQL server you have access to. Excuse the pun...
 

Users who are viewing this thread

Top Bottom