Problem with Apple Mac compatability

JShilt

New Member
Joined
Feb 14, 2016
Messages
17
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
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:

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Which version of Mac Office are they using?
 
Upvote 0
This
Code:
strPath = ActiveWorkbook.Path & "\" & Range("A3").Value + ".xlsm"

should be
Code:
strPath = ActiveWorkbook.Path & Application.PathSeparator & Range("A3").Value + ".xlsm"

As I don't use Outlook, I can't advise on that portion of the code.
 
Upvote 0

Forum statistics

Threads
1,213,496
Messages
6,113,993
Members
448,539
Latest member
alex78

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top