Someone helped me a while back and it worked, but for some reason it is not
working now. Before i list my macro, i am trying to have a button that asks
the person what sheet they would like to email, and then it emails that one
worksheet.
It is giving me the error he
With wb
.SaveAs quot;Part of quot; amp; ThisWorkbook.Name _
amp; quot; quot; amp; strdate amp; quot;.xlsquot;
Here is the entire macro
'Sub Mail_ActiveSheet_Outlook()
msg = msg amp; vbNewLine
msg = quot;Before Sending the information, to the data input department,
have you filled out all the required Information?quot;
msg = msg amp; vbNewLine amp; vbNewLine
msg = msg amp; quot;Have you filled in all the required CIP fields for ALL
signers on the account? quot;
msg = msg amp; vbNewLine
msg = msg amp; quot;Have you entered an account Number and Account Type? quot;
msg = msg amp; vbNewLine
msg = msg amp; quot;If this is a CD, have you filled in the certificate Number,
Interest Plan, etc?quot;
Title = quot;NORTH SHORE COMMUNITY BANK AND TRUST COMPANYquot;
Config = vbOKCancel vbQuestion
Ans = MsgBox(msg, Config, Title)
If Ans = vbOK Then
If Ans = vbCancel Then Exit Sub
Application.ScreenUpdating = False
Worksheets(quot;Data Input1quot;).Select
Dim OutApp As Object
Dim OutMail As Object
Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, quot;dd-mm-yy h-mm-ssquot;)
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs quot;Part of quot; amp; ThisWorkbook.Name _
amp; quot; quot; amp; strdate amp; quot;.xlsquot;
Set OutApp = CreateObject(quot;Outlook.Applicationquot;)
Set OutMail = OutApp.CreateItem(o)
With OutMail
.To = quot;email address.comquot;
.CC = quot;quot;
.BCC = quot;quot;
.Subject = quot;TYPE TITLE OF ACCOUNT HEREquot;
.Body = quot;TYPE MESSAGE HEREquot;
.Attachments.Add wb.FullName
.Display
End With
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Application.ScreenUpdating = True
Set OutMail = Nothing
Set OutApp = Nothing
Worksheets(quot;Printquot;).Select
Else
'Do Something Else
End If
End Sub
- Sep 29 Fri 2006 20:09
Print Macro Error
close
全站熱搜
留言列表
發表留言