Saved as, closed, now send?

Bundywa

New Member
Joined
Jul 27, 2010
Messages
6
Hi all,
Having all sorts of problems with sending a saved file.
I have made a form (in excel 2003) which has data placed into it each day. I have found a small code that when you press a command button on the sheet it saves it as a new file with the date added to the end of the file name, and put into a set folder on a server then closed down.
What I would like to happen is when the user clicks on the button an email copy of the newly saved file is to be sent to 3 email addresses.

The code is I have now is below...

Private Sub cmdClickToSaveAndClase_Click()
ActiveWorkbook.SaveAs "K:\9. Drill & Blast\9.22 Supervisors\9.22.06 Daily Drill Downtime Reports\Daily Sheets\Daily Drill Downtime Report " & Format(Date, "ddmmmyy") & ".xls"
ThisWorkbook.Close
End Sub

Any help would be most welcome
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
21,274
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Hi Bundy
Add this to the line before the workbbook close line
Code:
ActiveWorkbook.SendMail "NAME","NAME2","NAME3"
 

Bundywa

New Member
Joined
Jul 27, 2010
Messages
6
WOW..... :eek: I have spent so much time over the last couple of days trying to get this to work....

And all it took was this one little line......

You are a legend.. Thanks you so very much...
 

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
21,274
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Ahh, just one more for the Aussies.....LOL !!!
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,576
Messages
5,832,577
Members
430,143
Latest member
Monyo

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
Top