Applies To
Excel for Microsoft 365 for Mac Excel 2024 for Mac Excel 2021 for Mac

You can select another application's objects that you want available in your code by setting a reference to that application's object library.

Add an object

From the Developer tab, open a Visual Basic project window or press Alt+F11. If the Developer tab isn't visible, see Make the Developer tab visible.

  1. On the Tools menu on the top toolbar, select References.

    Tools preferences screenshot.

  2. Under Available References, select the check box for the object library that you want available in your Visual Basic project.

    References dialog screenshot.

    Note: You should clear the check box for the object libraries that you do not want in your Visual Basic project to reduce the time it takes to compile.

  3. To set the order in which the object libraries are accessed, under Available References, choose the object library, and then select the Priority buttons to move the object library up or down.

  4. To add other object libraries to Available References, select Browse on the right of the dialog, and then find the object library that you want.

    Browse other references screenshot.

  1. On the top bar, select Excel on the top toolbar and choose Preferences

  2. Under Ribbon & Toolbar. select Customize the Ribbon.

  3. Under Customize the Ribbon, select Main Tabs and then check Developer.

  4. Select Save and then close Excel Preferences.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.