I am very new at writing VB and have managed to send an email with Excel 2003. When I had to upgrade to 2010 so ended this to work. Is there anyone who could help me to make this work in Excel 2010. I have a problem with the format of date and when I save as. The file I'm working on now. Xlsm
Please i need help!!
Sub E_Post_Zon_1() ' ' Mail Macro ' Macro recorded 2011-07-06 by Santors Range("B8").Select ActiveCell.FormulaR1C1 = "61000" Range("B9").Select ' Dim strDate As String ActiveSheet.Copy strDate = Format(Date, "dd-mm-yy") & " " & Format(Time, "h-mm-ss") ActiveWorkbook.SaveAs "Test Stockholm" & ThisWorkbook.Name _ & " " & strDate & ".xls" ActiveWorkbook.SendMail "santors71@gmail.com", _ "Test Bonus " ActiveWorkbook.ChangeFileAccess xlReadOnly Kill ActiveWorkbook.FullName ActiveWorkbook.Close True END SUB
Regards Santors
Last edited by Santors; 12-08-2011 at 08:15 AM.
hi Santors
duplicate
sorry
Last edited by john55; 12-05-2011 at 03:29 AM.
Regards, John
hi Santors
please edit yr post adding [] before yr first line of code and [/] after tle last line. add the word code in between
![]()
Regards, John
Hey Here is the code ,
Code:
Option Explicit Sub Dave() Dim strDate As String Range("B8").Value = "61000" ActiveSheet.Copy strDate = Format(Date, "dd-mm-yy") & " " & Format(Time, "h-mm-ss") ActiveWorkbook.SaveAs "Test Stockholm" & ThisWorkbook.Name _ & " " & strDate & ".xlsm", FileFormat:=52 ActiveWorkbook.SendMail "your.email@gmail.com", _ "Test Bonus " ActiveWorkbook.ChangeFileAccess xlReadOnly Kill ActiveWorkbook.FullName ActiveWorkbook.Close True End Sub
If you are happy with the answer, please click the Star icon in the below left hand corner.
Good sites to start learning.
snb's VBA Help Files
Jerry Beaucaires Excel Assistant
J & R Excel Consultancy Services
How to post code correctly: Correct Code Posting
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks