jalrs
Active Member
- Joined
- Apr 6, 2022
- Messages
- 300
- Office Version
- 365
- Platform
- Windows
Hello forum experts,
As the subject suggests I'm having trouble with outlook screen updating. I would like to turn it off, meaning that every time I run the macro, the outlook doesn't pop up a new window. Instead, it should just keep running on the taskbar. I've tried with Application.ScreenUpdating method, but this fails to work.
Any help is greatly appreciated.
Thanks
As the subject suggests I'm having trouble with outlook screen updating. I would like to turn it off, meaning that every time I run the macro, the outlook doesn't pop up a new window. Instead, it should just keep running on the taskbar. I've tried with Application.ScreenUpdating method, but this fails to work.
Any help is greatly appreciated.
VBA Code:
Sub mailIsencao()
Dim OutApp As Object
Dim OutMail As Object
Dim ws1 As Worksheet, ws2 As Worksheet
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
Set ws1 = ThisWorkbook.Worksheets("Readme")
Set ws2 = ThisWorkbook.Worksheets("MACRO 4")
ws2.Activate
On Error Resume Next
Application.ScreenUpdating = False
With OutMail
.To = Cells(2, 2).Value
.CC = Cells(2, 3).Value
.Subject = Cells(2, 4).Value
.Body = Cells(2, 7).Value
.Display
.Attachments.Add "C:\Users\joafrodrigue\Desktop\share\finaldocname\ST_Isenção.xlsx"
End With
On Error GoTo 0
Set OutMail = Nothing
ws1.Activate
Application.ScreenUpdating = True
End Sub
Thanks