Recompiling your macro often resolves this issue on Microsoft Excel. If you haven’t already, see the steps below to recompile your Excel VBA Macro.
Access the Developers tab in Microsoft Excel.
Click on Visual Basic.
Go to the Tools tab and click on Options.
In the new window, access the General tab.
Enable the Compile on Demand option under the Compile section. Hit OK to save the changes.
Restart Microsoft Excel.