Forum Discussion

mnjaskiw's avatar
mnjaskiw
Copper Contributor
Aug 21, 2023

Excel for Mac - Macro Syntax Clarification

Hello,

 

Just moved over to Mac from Windows, and have been discovering that the OS seems to do things on its own without any notification.

 

Today, I discovered that a relatively basic macro that I had created was generating a "Run-time error '9': Subscript out of range", for no apparent reason (obviously).

 

I chatted with Mac support, ran the macro in OS Safe Mode, uninstalled and reinstalled Office for Mac, deleted and imported the module, all to no avail.

 

Then I discovered a StackOverflow post from five years ago outlining the same problem with a resolution to remove the file extension from the VBA code. This seems to be only required for Windows(...).Activate instances, whereas Workbooks(...).Activate still require the extension to be included.

 

My question today is: why did this suddenly happen?

 

The macro was working fine, even on the same Mac machine. All until today. What happened? Why did this change? Was it an OS "update"? Was it a MS "update"? is this something to which I can look forward occasionally, moving forward with Mac?

 

Any insight, advice, or information is appreciated.

  • mnjaskiw's avatar
    mnjaskiw
    Copper Contributor
    Additionally, am I going to be required to edit extensions out of all other macros that I use on this Mac? Are they still going to function on Windows systems?

Resources