Hello,
When the following macro is ran after being sent from Windows to Mac OS, we receive "Run-Time Error '429': ActiveX Component can't create object".
From my understanding, this is due to ActiveX not being support on Mac. Is there a way to alter the following code to work on mac?
When the following macro is ran after being sent from Windows to Mac OS, we receive "Run-Time Error '429': ActiveX Component can't create object".
From my understanding, this is due to ActiveX not being support on Mac. Is there a way to alter the following code to work on mac?
VBA Code:
Sub Button_Check()
Application.DisplayAlerts = False
Dim path As String
Dim filename1 As String
Dim emailApplication As Object
Dim emailItem As Object
Dim x As String
ApprRejQues = MsgBox("Change to Approved?", vbYesNo, "Select Option")
If ApprRejQues = vbYes Then
Range("F39").Value = "APPROVED " & Format(Now(), "yyyy-MM-dd hh:mm:ss")
ChDrive "F"
ChDir "F:\path"
filename1 = Range("N2") & Range("N3").Value
ActiveWorkbook.SaveAs Filename:=path & filename1, FileFormat:=52
ActiveWorkbook.SaveAs Filename:=filename1 & ".xlsm", FileFormat:=xlOpenXMLWorkbookMacroEnabled
Set emailApplication = CreateObject("Outlook.Application")
Set emailItem = emailApplication.CreateItem(0)
emailItem.to = "email"
emailItem.Subject = "Approval Requested"
emailItem.Body = "Document has been submitted and requires your attention for Approval."
emailItem.Attachments.Add ActiveWorkbook.FullName
emailItem.Send
Set emailItem = Nothing
Set emailApplication = Nothing
Application.DisplayAlerts = True
ActiveWorkbook.Close
Else
Range("F39").Value = "REJECTED " & Format(Now(), "yyyy-MM-dd hh:mm:ss")
x = InputBox("Reason for Rejection", "Data Entry Form")
With ActiveSheet
.Range("A44").Value = x
End With
'ChDrive "F"
'ChDir "F:\path"
'filename1 = Range("N2") & Range("N3").Value
'ActiveWorkbook.SaveAs Filename:=path & filename1, FileFormat:=52
'ActiveWorkbook.SaveAs Filename:=filename1 & ".xlsm", FileFormat:=xlOpenXMLWorkbookMacroEnabled
Set emailApplication = CreateObject("Outlook.Application")
Set emailItem = emailApplication.CreateItem(0)
emailItem.to = Range("C7").Value
emailItem.cc = "email"
emailItem.Subject = "Rejected"
emailItem.HTMLBody = "The attached document has been REJECTED for the following reason:" & "<br>" & "<br>" & x & "<br>" & "<br>" & "Please review as to why this document was rejected and communicate with the originator of the document as to whether additional changes should be made and resent for approval."
emailItem.Attachments.Add ActiveWorkbook.FullName
emailItem.Send
Set emailItem = Nothing
Set emailApplication = Nothing
Application.DisplayAlerts = True
ActiveWorkbook.Close
End If
End Sub
Last edited by a moderator: