Hi,
I read in this web site how to send & receive email in Excel, however I tried to run this code the error occurs in Format function with the following message: 'Wrong number of argument or invalid property assignment.
Mail Sheet Array using VBA in Microsoft Excel
• Create a new workbook with the SheetsArray.
• Save the workbook before mailing it.
• Delete the file from your hard disk after it is sent.
Sub Mail_SheetsArray()
Dim strDate As String
Sheets(Array("Sheet1", "Sheet3")).Copy
strDate = Format(Date, "dd-mm-yy") & " " & Format(Time, "h-mm-ss")
ActiveWorkbook.SaveAs "Part of " & ThisWorkbook.Name _
& " " & strDate & ".xls"
ActiveWorkbook.SendMail "ron@debruin.nl", _
"This is the Subject line"
ActiveWorkbook.ChangeFileAccess xlReadOnly
Kill ActiveWorkbook.FullName
ActiveWorkbook.Close False
End Sub
Could any one help me to understand and how to fix this error.
Thank you very much
Bookmarks