Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
can anyone find the flaw??
here's my macro and here's the issue. I've tested this with three computers, two work and one does not, i get a Run-time error 1004. Run-time error'1004': Microsoft Office Excel cannot access teh file 'N:'. There are several possible reasons: The file name or path does not exist The file name is being used by another program. the workbook you are tryig to save has the same name as a currently open workbook. Calculate Dim OutApp As Object Dim OutMail As Object Dim wb As Workbook Dim strdate As String strdate = Format(Now, "yyyy-mm-dd") Application.ScreenUpdating = False Sheets("Emailed").Visible = True Sheets("Emailed").Select ActiveSheet.Copy Set wb = ActiveWorkbook With wb .SaveAs ThisWorkbook.Name & " " & strdate & ".xls" Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(o) With OutMail .To = " .CC = "" .BCC = "" .Subject = "New Accounts Activity" .Body = "Please do a 'Paste Special' and choose 'Values and Number Formats'" .Attachments.Add wb.FullName .Display End With .ChangeFileAccess xlReadOnly Kill .FullName .Close False End With Application.ScreenUpdating = True Sheets("Emailed").Select ActiveWindow.SelectedSheets.Visible = False Set OutMail = Nothing Set OutApp = Nothing End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I create an email macro to auto fill the email? | Excel Discussion (Misc queries) | |||
Can you send a Macro to someone else by email? | Excel Discussion (Misc queries) | |||
macro to email | Excel Discussion (Misc queries) | |||
Macro To Email XLS | Excel Discussion (Misc queries) | |||
Macro - Copy - Email | Excel Worksheet Functions |