Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-07-2011, 05:53 AM
santors71 santors71 is offline Mail with macro Excel 2010 Windows 7 32bit Mail with macro Excel 2010 Office 2010 32bit
Novice
Mail with macro Excel 2010
 
Join Date: Dec 2011
Posts: 5
santors71 is on a distinguished road
Default Mail with macro Excel 2010


Hi
Need help with Excel macro. This macro works well in Excel 2003. Now when I use excl 2010 so it does not work anymore. The error I get is that it is the wrong format of date and Save As. Is there anyone who can help me, I am very grateful.
Santors

Sub E_Post_Zon_2()
'

Range("B8").Select
ActiveCell.FormulaR1C1 = "'00059"
Range("B9").Select
' Dim strDate As String
ActiveSheet.Copy
strDate = Format(Date, "dd-mm-yy") & " " & Format(Time, "h-mm-ss")
ActiveWorkbook.SaveAs "Tuppz Prognos " & ThisWorkbook.Name _
& " " & strDate & ".xls"
ActiveWorkbook.SendMail santors71@gmail.com, _
"Tuppz Prognos Ford Bonus "
ActiveWorkbook.ChangeFileAccess xlReadOnly
Kill ActiveWorkbook.FullName
ActiveWorkbook.Close True

End Sub
Reply With Quote
  #2  
Old 12-07-2011, 06:34 AM
macropod's Avatar
macropod macropod is online now Mail with macro Excel 2010 Windows 7 64bit Mail with macro Excel 2010 Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 20,825
macropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant future
Default

Hi Santors,

Regarding the date, what is the error message? Also, you could simplify that line with:
strDate = Format(Now, "DD-MM-YY h-mm-ss")

As for the Save As, what is the error message? Have you tried specifying the fileformat (it's one of the Save As parameters)?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for sending mail and opening the sent mail afterwards Rumlegok Outlook 0 09-20-2011 07:27 AM
Mail with macro Excel 2010 Word Doc Macro (mail Merge) ajolson1964 Word VBA 1 05-10-2011 10:15 PM
Mail with macro Excel 2010 Run a Macro in Word 2010 Joyce301 Word VBA 3 04-29-2011 03:27 PM
utlook 2010 is not receiving G-mail (IMAP) E-mail CGChicago Outlook 0 12-28-2010 03:49 PM
Error: general mail failure. Quit excel restart mail system MitchellDM Outlook 1 12-19-2008 02:05 AM

Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 02:21 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2021 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft