monkeymaster
New Member
- Joined
- Oct 15, 2021
- Messages
- 3
- Office Version
- 365
- Platform
- Windows
I have a macro written on my PC that automatically generates emails based on 4 cells (to:, cc:, subject;, and body). However, I am training an employee at work to use the macro, but they have a Macbook.
How can I get this macro to work on Macs? I have zero coding experience and managed to put this together with help from this board.
Sub Mail_Workbooks()
Dim OutApp As Object, OutMail As Object, WS As Worksheet, r As Long
Set OutApp = CreateObject("Outlook.Application")
Set WS = Sheets("MACRO")
On Error Resume Next
For r = 2 To WS.Cells(Rows.Count, "A").End(xlUp).Row
With OutApp.CreateItem(0)
.To = WS.Cells(r, "A").Value
.CC = WS.Cells(r, "B").Value
.Subject = WS.Cells(r, "C").Value
.Body = WS.Cells(r, "D").Value
.Display
End With
DoEvents
Next r
On Error GoTo 0
Set OutApp = Nothing
End Sub
How can I get this macro to work on Macs? I have zero coding experience and managed to put this together with help from this board.
Sub Mail_Workbooks()
Dim OutApp As Object, OutMail As Object, WS As Worksheet, r As Long
Set OutApp = CreateObject("Outlook.Application")
Set WS = Sheets("MACRO")
On Error Resume Next
For r = 2 To WS.Cells(Rows.Count, "A").End(xlUp).Row
With OutApp.CreateItem(0)
.To = WS.Cells(r, "A").Value
.CC = WS.Cells(r, "B").Value
.Subject = WS.Cells(r, "C").Value
.Body = WS.Cells(r, "D").Value
.Display
End With
DoEvents
Next r
On Error GoTo 0
Set OutApp = Nothing
End Sub