Attach an exported excel and send mail to a person

Bucephalus

Registered User.
Local time
Today, 21:48
Joined
May 21, 2012
Messages
14
Hi,

I already created a Macros to run a query and export the query in an excel format to a specified location in my local drive but now i want also the same file to be sent as an attachment to a person's mail id,when the macros is run on autoexec.
can anyone help me pls?
 
As far as I know, there is no option in the standard Macro system to perform sending an email. There is an option for sending an email using a Data Macro only. See this link:
http://msdn.microsoft.com/en-us/library/ff196780.aspx

To send an email you will need to use VBA code. You can create a custom, user defined function and call that function from a macro, but you will still need to write the VBA code to create the custom function. This function could also attache the exported Excel file to the email.

Secondly, having or creating a macro named "AutoExec" is to be used to run code or othere macros at the time the database file is opened. I would not expect to see a database application where it would immediately start sending out emails when the file was opened.

Macro can be run using command buttons on a form or from other events related to form or other objects in a form. Macros can even be run using a user defined Key combination.

Hope this helps.
 

Users who are viewing this thread

Back
Top Bottom