I am creating a worksheet that is used by both Mac and PC users.
The following two bits of code work on the PC but fail on Mac
I don't have a Mac of my own so I have to ask a co-worker if the sheet works but cannot do any troubleshooting on the Mac.
Could one of you fine folks that owns a Mac test this out for me?
Thanks in advance
Note that the error the Mac user gets says you cannot open another sheet with the same name. The Cell A3 is a CONCATENATE cell that creates a file name with our required file format.
The following two bits of code work on the PC but fail on Mac
I don't have a Mac of my own so I have to ask a co-worker if the sheet works but cannot do any troubleshooting on the Mac.
Could one of you fine folks that owns a Mac test this out for me?
Thanks in advance
Code:
Sub EmailandSaveCellValue()
Dim strPath As String
strPath = ActiveWorkbook.Path & "\" & Range("A3").Value + ".xlsm"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs strPath
Application.DisplayAlerts = True
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.to = "xx@xx.com"
.CC = ""
.BCC = ""
.Subject = Range("A3").Value
.Body = ""
.Attachments.Add ActiveWorkbook.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
MsgBox "Your Demo Request has been e-mailed to Applications Department"
End Sub
Sub FileName_Copy_SlicingRequest()
Dim strPath As String
strPath = ActiveWorkbook.Path & "\" & Range("A3").Value + ".xlsm"
ActiveWorkbook.SaveAs strPath
End Sub
Note that the error the Mac user gets says you cannot open another sheet with the same name. The Cell A3 is a CONCATENATE cell that creates a file name with our required file format.
Last edited by a moderator: