none
Excel (Office 365) VBA for Mac - Events "Worksheet_SelectionChange" and "Worksheet_Change" don't work. RRS feed

  • Question

  • I have an Excel application using VBA macros including the two events "Worksheet_SelectionChange" und "Worksheet_Change" that run perfectly well under windows but not under my mac environment (MacBook Pro, Office 365).

    Certainly, I must do something wrong because I cannot imagine, that Microsoft had not integrated these important events into the Office 365 software. The structure of my sub instructions look like follows:

    ----------------------------------------------------------------------

    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
          Application.EnableEvents = False     
          If Target.Address = "$D$14" Then
            .....
          End If
        Application.EnableEvents = True
    End Sub

    ----------------------------------------------------------------------

    Unfortunately, I didn't find any answer by searching the internet so far, but many others seaming to have the same problem.

    Thanks, I appreciate any answer on this topic.

    Paul


    Saturday, September 7, 2019 8:48 AM

All replies

  • Hi,

    I tried your code with Windows 10 and Office 2016 (not Office 365), and found nothing wrong.
    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
          Application.EnableEvents = False
          If Target.Address = "$D$14" Then
            MsgBox "D14 changed"
          End If
        Application.EnableEvents = True
    End Sub
    Could you explain what happens when cell D14 is changed?

    Regards,

    Ashidacchi -- https://ssl01.rocketnet.jp/hokusosha.com/default.html

    Sunday, September 8, 2019 2:33 AM
  • Dear Ashidacchi,

    Sorry that I answer only now, but your question started a long time of investigating my code. Immediately after your reply, I tried my excel program again and what a surprise: it worked. But then after a restart, the two functions didn't not work again. I set up a simple test version, just using the two events: nothing happened first, but later on they worked fine.

    My summary so far: Sometimes the two events work, when I start another fuction, sometimes not. Just by chance I discovered, that clicking the termination button of excel and choose the abort option, the two events start working. Once the work, they keep working. Wehn I did the same with my test example, the messages I built into popped up much delayed as the had been waiting for some trigger.

    So really, I have no clue what's going on. There must be something in my environment - excel office 365 vba for Mac - that prevents the two events to function properly. After struggling so long, I think I need to give up.

    Thanks for your support anyway

    Paul


    Thursday, September 12, 2019 10:35 AM
  • Hi pauliten,

    It is too sorry to say that Microsoft's software products have some faults even if they are updated. This would get worse as times goes by. (It would be common between Windows and Mac OS)
    I don't and will have Mac and Office 365, so I need to give up.
    (Sorry for my poor English)

    Regards,

    Ashidacchi -- https://ssl01.rocketnet.jp/hokusosha.com/default.html

    Thursday, September 12, 2019 10:57 AM