i try to call fraud check then it hits the call email and fails saying expected variable or procedure not module
what am i doing wrong?
then email code is
what am i doing wrong?
Code:
[/COLOR][COLOR=rgb(0, 0, 0)]Call EmailTotalFraud[/COLOR][COLOR=rgb(184, 49, 47)] thius is where it fails[/COLOR]
End Sub
then email code is
Rich (BB code):
Sub EmailTotalFraud()
Dim sMail As String, sSubj As String, sBody As String
Dim TotalFraud As String: TotalFraud = Worksheets("Fraud Check").Range("TotalFraudulent")
Dim TotalAgencyFraud As String: TotalAgencyFraud = Worksheets("Fraud Check").Range("AgencyFraudulent")
Dim FileName As String: FileName = "Individual and Agency Fraud Check " & Replace(ReportDate, "/", ".")
Dim FullFilePath As String
Dim ReportDate As String: ReportDate = Date
Dim SaveFolder1 As String: SaveFolder1 = "M:\all\Fraud Check Complete\"
FullFilePath = ExportFolder & PeriodRunFolder
sMail = "xxxx@gmail.org"
sSubj = " Fraud Check"
sBody = "Fraud check was processed and reviewed on " & Date & " Total Individual Fraud found " & TotalFraudulent & " Total Agency Fraud found " & AgencyFraudulent & "." & vbCrLf & _
FileName & "can be found in " & SaveFolder1
Call SendMailTotal(sMail, sSubj, sBody)
End Sub
Sub SendMailTotal(sMail, sSubj, sBody)
Dim OutlookApp As Object
Set OutlookApp = CreateObject("Outlook.Application").CreateItem(0)
With OutlookApp
.To = sMail
.Subject = sSubj
.Body = sBody
.Display 'Display Email
' .Send 'Send Email
End With
End Sub