Share via

No Auto_Open macro?

Anonymous
2012-11-02T12:32:29+00:00

Hello -

I'm migrating a workbook and associated macros from Windows to Mac.  The Auto_Open macro doesn't run when the workbook is opened.  Has that feature been removed from this version or have I done something dumb?

Thanks!

Tim

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2012-11-03T00:20:59+00:00

Auto_Open() will work only if it's in a regular (non-workbook or worksheet class, i.e., ThisWorkbook, or Sheet1, Sheet2, etc.) module.

Otherwise, use the Workbook_Open() event macro (as you do above) in the ThisWorkbook() module.

Was this answer helpful?

0 comments No comments

Answer accepted by question author

Anonymous
2012-11-02T19:08:59+00:00

Auto_Open is the name defined for an XLM macro. For VBA, use the workbook_open event in the thisworkbook code page.

Was this answer helpful?

0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Anonymous
    2012-11-02T17:47:56+00:00

    I don't get an error message.  It just seems that the macro doesn't run.  In my efforts to figure out what the problem is, I created a new workbook with a simple macro:

    Sub Auto_Open()

    MsgBox "It works."

    End Sub

    When I open the workbook, I don't see the message box.  If I run the macro "manually", I see the message box.

    I'm stumped.

    Was this answer helpful?

    0 comments No comments
  2. Jim G 134K Reputation points MVP Volunteer Moderator
    2012-11-02T17:07:50+00:00

    Auto_Open() works fine in Excel for Mac.

    Are you getting an error message? What happens when you try to run your macro?

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2012-11-02T14:23:24+00:00

    Macros should be written I believe it's called Classic. Active-X doesn't exist on Mac.

    One of the MVP's will most likely give the correct Macro Language.

    Was this answer helpful?

    0 comments No comments