Word template done in VB, works on Windows but does not work on Mac?

khurshed Patel 1 Reputation point
2021-12-01T06:25:15.317+00:00

153934-screen-shot-2021-12-01-at-72054-pm.png

This word template done in VB works perfectly well on Windows but when I open in Mac, the 'Cancel' or 'Next' or 'Ok' buttons does not work and give a debug error. (screenshot attached)
How can I fix this? Please guide me.

I am running Word 2016 version.

Thanks

Microsoft 365 and Office | Word | For business | Windows
Developer technologies | Visual Basic for Applications
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. John Korchok 6,306 Reputation points Volunteer Moderator
    2021-12-01T22:29:38.337+00:00

    SendKeys is not available in VBA for the Mac. It's possible to replace it with an AppleScript. This post has a reply about halfway down the page that has some details about implementing this: VBA: SendKeys for the Mac. Please note that current versions of Office for Mac use AppleScriptTask instead of the older MacScript command. Run an AppleScript with VBA

    I doubt you need to run a SendKeys command from that command button. What is that key supposed to do? There's likely an better alternative.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.