- Vytvorte nový zošit pomocou SheetsArray.
- Pred odoslaním zošita si ho uložte.
- Po odoslaní odstráňte súbor z pevného disku.
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" [email protected] ", _" This is the Subject line "ActiveWorkbook.ChangeFileAccess xlReadOnly Kill ActiveWorkbook .FullName ActiveWorkbook. Zatvorte podsekciu False End