#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 504
Default Email macro

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I create an email macro to auto fill the email? Justin[_4_] Excel Discussion (Misc queries) 0 November 14th 07 10:49 PM
Can you send a Macro to someone else by email? Greenback Excel Discussion (Misc queries) 3 August 2nd 06 01:01 PM
macro to email Scott Marcus Excel Discussion (Misc queries) 1 June 21st 06 03:04 PM
Macro To Email XLS ynissel Excel Discussion (Misc queries) 4 May 26th 05 07:12 PM
Macro - Copy - Email John Excel Worksheet Functions 1 March 2nd 05 07:36 PM


All times are GMT +1. The time now is 12:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"