coveredinbutter
New Member
- Joined
- Dec 20, 2021
- Messages
- 19
- Office Version
- 365
- Platform
- Windows
Hello everyone,
I have an issue with some workbooks I've created that will take the users input and mail it back. I use the code on multiple different forms and it has worked for years. As of a couple days ago, it now fails with the following error:
Below is the code I'm using up to the point it fails, so
is no longer working.
Hoping someone has an idea why it is failing all of a sudden. Appreciate any help.
I have an issue with some workbooks I've created that will take the users input and mail it back. I use the code on multiple different forms and it has worked for years. As of a couple days ago, it now fails with the following error:
Below is the code I'm using up to the point it fails, so
VBA Code:
Set OL = CreateObject("outlook.application")
Hoping someone has an idea why it is failing all of a sudden. Appreciate any help.
VBA Code:
Public Sub Mail_Sheet_Outlook_Body()
Set Proxy = Worksheets("Proxy")
Set Locals = Worksheets("Locals")
Dim rng As Range
Dim OutApp As Object
Dim OutMail As Object
Dim Item As Object
Dim Send_Address As String
' With Application
' .EnableEvents = False
' .ScreenUpdating = False
' End With
'Group Name
varName1 = Locals.Cells(2, 27).Value
'Shift Type
varName2 = Proxy.Cells(9, 7).Value
'Leader
varName0 = "Leader Submission"
Set rng = Nothing
LastPatternRow = ActiveSheet.Cells(11, 1).End(xlDown).Row
Set rng = ActiveSheet.Range(Cells(1, 7), Cells(LastPatternRow, 7))
'old
'Set rng = ActiveSheet.Range("G1:G301")
'You can also use a sheet name
'Set rng = Sheets("YourSheet").UsedRange
Dim OL, olAllUsers, oExchUser, oentry, myitem As Object
Dim User As String
Set OL = CreateObject("outlook.application")
Set olAllUsers = OL.Session.AddressLists.Item("All Users").AddressEntries