SOLVED

Order of Add-In loading at startup

Copper Contributor

Hi!

 

At Excel-startup I get the Error-Message: This workbook is currently referenced by another workbook and cannot be closed. I know why it happens, and how to solve it, but I cannot find which settings are responsible. 

 

The problem:

I have written a small library of macros divided into files by category. File A contains string functions, File B contains math, ... 

Some higher level macros depends on basic macros in other files. So I get a dependency tree. Excel seems to open all of these "Add-In" files, when all open it closes the files, I think in alphabetical order. Unfortunately Excel is unable to determine any kind of dependency. I am forced to click OK on several error-dialogs at every startup with the message above.

 

In Excel for Windows you can define the order of Add-In loading by editing the registry HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Excel\Options.

 

I cannot find such settings on macOS. 

 

Putting all code into one file is not an option. 

2 Replies
best response confirmed by Mach_7 (Copper Contributor)
Solution

@Mach_7 

Excel for Mac does not provide a built-in option to control the order of Add-In loading at startup like in Excel for Windows through the registry…so far I know. However, there might be alternative approaches you can consider to address the issue:

1. Manual Loading Order: You can manually load the Add-Ins in the correct order each time you start Excel. This might be cumbersome, but it ensures that the dependencies are resolved correctly.

2. VBA Startup Code: You can create a VBA macro that runs automatically when Excel starts and loads the Add-Ins in the correct order. This macro can be triggered by Excel's Workbook_Open event. Here's a basic example:

Vba code is untested, please backup your file.

 

Private Sub Workbook_Open()
    ' Load Add-Ins in the desired order
    Application.AddIns("AddIn1.xlam").Installed = True
    Application.AddIns("AddIn2.xlam").Installed = True
    ' Add more Add-Ins as needed
End Sub

 

You would need to adjust the names of the Add-Ins (AddIn1.xlam, AddIn2.xlam, etc.) and the order as per your requirements.

3. Third-Party Tools: There might be third-party tools or utilities available that allow you to manage Add-Ins and their loading order on Excel for Mac. You could explore options provided by such tools to see if they meet your requirements.

4. Feedback to Microsoft: You can provide feedback to Microsoft through their official channels, such as the Excel UserVoice website or directly through Excel's built-in feedback feature. Requesting the ability to control Add-In loading order on Excel for Mac may lead to improvements in future versions.

While these alternatives may not provide the exact solution you're looking for, they might offer workarounds to mitigate the issue until a more suitable solution becomes available. The text was created with the help of AI.

 

My answers are voluntary and without guarantee!

 

Hope this will help you.

 

Was the answer useful? Mark as best response and like it!

This will help all forum participants.

This actually a superior approach, because I can define w/o gui which dependencies have to be loaded!
1 best response

Accepted Solutions
best response confirmed by Mach_7 (Copper Contributor)
Solution

@Mach_7 

Excel for Mac does not provide a built-in option to control the order of Add-In loading at startup like in Excel for Windows through the registry…so far I know. However, there might be alternative approaches you can consider to address the issue:

1. Manual Loading Order: You can manually load the Add-Ins in the correct order each time you start Excel. This might be cumbersome, but it ensures that the dependencies are resolved correctly.

2. VBA Startup Code: You can create a VBA macro that runs automatically when Excel starts and loads the Add-Ins in the correct order. This macro can be triggered by Excel's Workbook_Open event. Here's a basic example:

Vba code is untested, please backup your file.

 

Private Sub Workbook_Open()
    ' Load Add-Ins in the desired order
    Application.AddIns("AddIn1.xlam").Installed = True
    Application.AddIns("AddIn2.xlam").Installed = True
    ' Add more Add-Ins as needed
End Sub

 

You would need to adjust the names of the Add-Ins (AddIn1.xlam, AddIn2.xlam, etc.) and the order as per your requirements.

3. Third-Party Tools: There might be third-party tools or utilities available that allow you to manage Add-Ins and their loading order on Excel for Mac. You could explore options provided by such tools to see if they meet your requirements.

4. Feedback to Microsoft: You can provide feedback to Microsoft through their official channels, such as the Excel UserVoice website or directly through Excel's built-in feedback feature. Requesting the ability to control Add-In loading order on Excel for Mac may lead to improvements in future versions.

While these alternatives may not provide the exact solution you're looking for, they might offer workarounds to mitigate the issue until a more suitable solution becomes available. The text was created with the help of AI.

 

My answers are voluntary and without guarantee!

 

Hope this will help you.

 

Was the answer useful? Mark as best response and like it!

This will help all forum participants.

View solution in original post