I have written an Excel workbook for Windows, and am now trying to make it work on Excel for Mac 2011. Several times in my code I call subs that are inside different worksheet objects. With Windows, it works fine to call them like this:
However, on Mac it gives me: Runtime Error '1004' - Application-defined or object-defined error
FYI -- "AnotherSub" is not a Private sub.
If I try to call a sub that is inside a regular Module in this same way, it works fine. For instance:
The above works.
I tried doing it like this, but this also gave the same error.
Anyone know why I am getting the error, and how I can fix it?
Code:
Sub MySub
If x = 1 Then Sheet1.AnotherSub
End Sub
However, on Mac it gives me: Runtime Error '1004' - Application-defined or object-defined error
FYI -- "AnotherSub" is not a Private sub.
If I try to call a sub that is inside a regular Module in this same way, it works fine. For instance:
Code:
If x = 1 Then Module1.DifferentSub
The above works.
I tried doing it like this, but this also gave the same error.
Code:
If x = 1 Then Call Sheet1.AnotherSub
Anyone know why I am getting the error, and how I can fix it?
Last edited: