asked on
Public Sub CreateSendMail()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Dim wb As Workbook
Dim wb1 As Workbook
Set wb1 = ThisWorkbook
Sheets(Array("Synth", "HistoChart", "LiqProv", "90-8DayDelta", "LiqProvDetail", "LiqProvUSD", "ClientMaturitiesProfile", "LiqProvGBP", _
"LiqProvEUR")).Copy
Set wb = ActiveWorkbook
ChDir wb1.Worksheets("ProviderAnalysisSetUp").Range("b3").Value
wb.SaveAs Filename:= _
wb1.Worksheets("ProviderAnalysisSetUp").Range("b3").Value & "LiqClientProviderLON.xlsx", FileFormat:= _
xlOpenXMLWorkbook, CreateBackup:=False
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.to = "ron@debruin.nl"
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
.Attachments.Add wb1.Worksheets("ProviderAnalysisSetUp").Range("b3").Value & "LiqClientProviderLON.xlsx"
.Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
ASKER
ASKER
ASKER
Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.
TRUSTED BY
pls try
Open in new window
Regards