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:

Some videos you may like

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
36,151
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
Which version of Mac Office are they using?
 

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
23,920
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,322
Messages
5,600,951
Members
414,417
Latest member
Nobu

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
Top