Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think i may have deleted a part of code ina module to now cause a Compile
Error. The error is: "Sub or Fuction Not Defined." The error line is highlighted in the code below. Can some help me fix this? Sub SendPDF() Dim OutApp As Object Dim OutMail As Object With Application .ScreenUpdating = False .EnableEvents = False End With Set OutApp = CreateObject("Outlook.Application") OutApp.Session.Logon Set OutMail = OutApp.CreateItem(0) With OutMail .To = Sheet1.Range("B13").Value .CC = Sheet1.Range("B15").Value .BCC = "" .Subject = Sheet1.Range("B63").Value .Body = Sheet1.Range("B65").Value If Not FileExists("\\Server\Pdf's\" & Range("G5").Value & ".pdf") Then ' <=== ERROR MsgBox "The pdf file doesn't exist! " & "Please check the pdf File Name you just saved" & vbCrLf & vbCrLf & "It MUST be saved as " & Sheet1.Range("G5").Value & " ONLY!", vbCritical, "...." Exit Sub Else .Attachments.Add ("\\Server\Pdf's\" & Range("G5").Value & ".pdf") End If .send End With On Error GoTo 0 Set OutMail = Nothing Set OutApp = Nothing With Application .ScreenUpdating = True .EnableEvents = True End With Sheet1.Range("B64").Value = Time & Date Sheets("Information").Range("B64").Value = Format(Sheets("Information").Range("B64").Value, "hh:mmAM/PM dddd dd mmmm yyyy ") Sheet1.Protect End Sub -- Corey .... The Silliest Question is generally the one i forgot to ask. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
error sending email (as attachment) from within Excel 2000 | Excel Discussion (Misc queries) | |||
Sending attachment from excel | Setting up and Configuration of Excel | |||
Sending exel attachment | Excel Discussion (Misc queries) | |||
Sending a spreadsheet as an attachment | Excel Programming | |||
Sending spreadsheet as attachment | Excel Programming |