windows ppt macro doesn't work on mac

Discussion in 'Mac Programming' started by bruinsrme, Mar 3, 2017.

  1. bruinsrme macrumors 603

    bruinsrme

    Joined:
    Oct 26, 2008
    #1
    Hello my fellow mac programmers
    I am not a programmer on either windows or mac.

    the best I am is a windows guy able piece together some basic macros.

    A presentation I built has a macro that sends me an email and closes powerpoint when a control button is pressed. Very simple. However, windows coding doesn't work with mac. I have a handful of users that are on mac.

    Anyone feel like recompiling this windows macro to work on a mac?
    Private Sub CommandButton1_Click()

    Dim olApp As Object, olMail As Object
    Set olApp = CreateObject("Outlook.Application")
    Set olMail = olApp.CreateItem(0)
    olMail.To = "someoneemail@mail.com"
    olMail.Subject = "I have read & understand the use of "
    olMail.Body = "I have read & understand the use of "

    olMail.send

    ActivePresentation.Close

    End Sub

    Many thanks in advance
     
  2. AtomicGrog macrumors regular

    Joined:
    Jul 25, 2011
    #2
    None of the ActiveX/VBA based macro/coding stuff works on any of the Mac 'Microsoft Office' suite components (Excel, Word, PPT etc.).

    One of my bugbears to be honest, limits what I can do at home vs. work when using excel.

    Options?

    1. If you want 100% compatibility with the M$/Windows/VBA equivalent then either move them to a PC or run VMWARE/PARALLELS with Windows and Office for windows (Costly... $400+?)

    2. Use the OSX scripting language (Example: http://www.mactech.com/articles/mactech/Vol.21/21.09/ScriptingMail/index.html)

    3. Accept you cant run the macros (My default setting...)
    Regards
     
  3. Beachguy, Mar 6, 2017
    Last edited: Mar 6, 2017

    Beachguy macrumors 6502a

    Beachguy

    Joined:
    Nov 23, 2011
    #3
    What do you mean? I use interchangeable spreadsheets with VBA and Macros all the time in Excel for Mac. In Excel 2016, the compatibility is much improved.

    Edit: Ah- are you referring to the VBE and not VBA itself?

    Edit #2: This is what I get for opening my mouth without looking. CRAP! Where did the developer environment go? We just upgraded to 2016 last week, and I did not go into the developer environments. It's all gone!!!
     
  4. bruinsrme thread starter macrumors 603

    bruinsrme

    Joined:
    Oct 26, 2008
    #4
    Wow! I find that truly limiting.
    On the windows side I put the control button and the windows users review the material, clicked the button and it sent me an email stating completion.
    Shocked the mac side has such limitations.
    This is very troublesome as my CEO has asked me to redo the corporate PowerPoint presentation. The executives all run on mac.
     
  5. techwarrior, Mar 7, 2017
    Last edited: Mar 7, 2017

    techwarrior macrumors 6502a

    techwarrior

    Joined:
    Jul 30, 2009
    Location:
    Colorado
    #5
    I use VBA in Excel 2016 for Mac daily. I have yet to run into compatibility issues between Mac and PC, but understand there are some methods not supported (my automation is not too complex).

    In PPT, I do not see any way to create VBA code (no Dev tab as in Excel or Word). However, the Security & Privacy settings do allow you to Enable All Macros. So, it may be automation created on PC can in fact work on Mac, but don't expect all methods to work. For instance, the mail integration may not work on Mac (just speculating). Or, maybe the VBA editor launched from Excel or Word can be used to create PPT code?

    Maybe your method could use an AppleScript handler to generate the email?

    According to the following site, it appears MS intends to enhance VBA across all Mac Office apps in time:

    https://dev.office.com/blogs/VBA-improvements-in-Office-2016
     

Share This Page