Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John
 
Posts: n/a
Default Print Macro Error

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 "Part of " & ThisWorkbook.Name _
& " " & strdate & ".xls"

Here is the entire macro

'Sub Mail_ActiveSheet_Outlook()
msg = msg & vbNewLine
msg = "Before Sending the information, to the data input department,
have you filled out all the required Information?"
msg = msg & vbNewLine & vbNewLine
msg = msg & "Have you filled in all the required CIP fields for ALL
signers on the account? "
msg = msg & vbNewLine
msg = msg & "Have you entered an account Number and Account Type? "
msg = msg & vbNewLine
msg = msg & "If this is a CD, have you filled in the certificate Number,
Interest Plan, etc?"
Title = "NORTH SHORE COMMUNITY BANK AND TRUST COMPANY"
Config = vbOKCancel + vbQuestion
Ans = MsgBox(msg, Config, Title)
If Ans = vbOK Then
If Ans = vbCancel Then Exit Sub
Application.ScreenUpdating = False
Worksheets("Data Input1").Select
Dim OutApp As Object
Dim OutMail As Object
Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "Part of " & ThisWorkbook.Name _
& " " & strdate & ".xls"
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(o)
With OutMail
.To = "email address.com"
.CC = ""
.BCC = ""
.Subject = "TYPE TITLE OF ACCOUNT HERE"
.Body = "TYPE MESSAGE HERE"
.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("Print").Select
Else
'Do Something Else
End If
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
Macro Error...OUT OF MEMORY G118 Excel Discussion (Misc queries) 1 October 15th 05 09:35 PM
Macro to change validation list and print Andy Excel Discussion (Misc queries) 1 September 19th 05 01:42 PM
Create a print macro that would automatically select print area? wastedwings Excel Worksheet Functions 7 August 22nd 05 10:36 PM
run macro error, please help [email protected] Excel Discussion (Misc queries) 0 February 8th 05 03:52 AM
Print Macro NICK Excel Discussion (Misc queries) 1 December 20th 04 03:20 AM


All times are GMT +1. The time now is 12:24 AM.

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"