Hey guys,
As of late, I've been having some strange issue when generating Outlook Mail windows through VBA.
Has anyone ever encountered a situation where there was some overlay issue? Anytime an email window is created and shown using .display, I cannot press send, or otherwise interact with anything on the window. If I hover over the input fields, some new ones appear ontop of everything else -- those inputs I am able to interact with.
Anyone have any ideas what may be causing this behaviour? Below is the code I use to generate these emails -- pretty standard stuff.
And here is a screen grab of the issue:
I appreciate any feedback or suggestions anyone can offer.
Thank you.
As of late, I've been having some strange issue when generating Outlook Mail windows through VBA.
Has anyone ever encountered a situation where there was some overlay issue? Anytime an email window is created and shown using .display, I cannot press send, or otherwise interact with anything on the window. If I hover over the input fields, some new ones appear ontop of everything else -- those inputs I am able to interact with.
Anyone have any ideas what may be causing this behaviour? Below is the code I use to generate these emails -- pretty standard stuff.
Code:
' defined at the beginning of my code
Dim olApp As Object
Dim olMail As Object
Set olApp = CreateObject("Outlook.Application")
' there are 4 other code blocks that appear like this
Set olMail = olApp.CreateItem(0)
With olMail
.To = "example@email.com"
.Subject = "SA3 Reports"
.Body = "Hello," & vbCr & vbCr _
& "Please review the attached SA3 Reports for your stores." & vbCr & vbCr _
& "Thank you," & vbCr _
& "Your Payroll Team"
For Each wgStore In wgGroup
Filename = ThisWorkbook.path & "\SA3 Splits\SA3 Report - " & wgStore & ".xlsx"
If Not Dir(Filename, vbDirectory) = vbNullString Then
.Attachments.Add Filename
End If
Next wgStore
.Display
End With
Set olMail = Nothing
And here is a screen grab of the issue:
I appreciate any feedback or suggestions anyone can offer.
Thank you.