Share via

Loading template Add-In using vba: It takes much longer time for "VBA addIns.add fileName:=..." to finish since several weeks ago

Zhu, Ligong 285 Reputation points
2026-03-04T11:20:39.81+00:00

Hi,

We have a piece of VBA code to load an internal autotext file to current Word file during document opening event. The autotext file only about 700K. This piece of code has been in production for many years and worked fine until several weeks ago. Recently many people have reported that it is very slow to run this code and we found out that this line "VBA addIns.add fileName:=..." is the problem. It takes one to two minutes to execute this line, instead of seconds in the past. You can see the screenshot for more information.Screenshot 2026-03-04 060200

User's image

Please let us know what we can do to fix this problem. Thanks.

Microsoft 365 and Office | Word | For business | Windows
{count} votes

3 answers

Sort by: Most helpful
  1. John Korchok 230.1K Reputation points Volunteer Moderator
    2026-03-04T19:12:10.48+00:00

    It's not possible to test given the material you have provided, but I have a couple of guesses.

    I would start by resaving the target .DOT file to .DOTX, update the file name in your macro and test again.

    You could also be experiencing a slowdown because the file is installed to a non-standard location. Placing the AutoText template in the Word Startup folder would simplify your code a little and may speed things up, because it's an accepted folder in the Word ecosystem for global templates.

    3 people found this answer helpful.

  2. Charles Kenyon 164.1K Reputation points Volunteer Moderator
    2026-03-04T19:31:07.4333333+00:00

    I join John in recommending that you place your Add-In in the Word Startup folder. You can even simply put a shortcut to it in the Startup folder, but if you do that, the actual location should also be a Trusted Location.

    He is correct that saving your .dot file as a .dotx is likely to make things go smoother. I've done this with my Add-in files that were originally .dot files (.dotm in most cases).

    Once you have the file in a Startup location, you need no code to load it. It is automatically loaded each time Word starts.

    Resources:

    1 person found this answer helpful.

  3. Nam-D 2,165 Reputation points Microsoft External Staff Moderator
    2026-03-04T13:30:40.54+00:00

    Hello @Zhu, Ligong,

    Welcome to the Microsoft Q&A forum. 

    Thank you for providing the detailed information about the issue you are facing. Based on what you shared, it appears that you are encountering a problem when running VBA code to add add‑ins to an Office application. You also mentioned that this process was working properly several weeks ago, but has recently stopped functioning as expected. 

    To help determine whether this behavior is related to a recent Office update, I kindly ask you to try reverting your Office installation to an earlier build. This will help us rule out any compatibility conflicts between the latest Office version and your VBA script. 

    Since your device is using the Monthly Enterprise Channel, you may consider reverting to the January 2026 build or an earlier version. Please follow the steps in the official Microsoft article below: 

    How to revert to an earlier version of Office - Microsoft Support 

    You can review all available build versions here: 

    Update history for Microsoft 365 Apps (listed by date) - Office release notes | Microsoft Learn 

    Before reverting your Office version, please clear the Excel cache by following these steps: 

    1. Open Excel
    2. Go to File > Options > Save
    3. Scroll to the bottom and select Delete cached files
    4. Click OK, then restart Excel. 

    After completing the steps above, please try running your VBA code again. 

    If the issue persists, hope you will understand that I am unable to provide in‑depth assistance with custom scripting or VBA development within this forum. Therefore, to receive accurate and specialized guidance, I recommend posting your question in one of the following communities: 

    StackOverflow – A highly active community for VBA and macro-related inquiries.  (Note: Microsoft provides this link for your convenience. These sites are not operated or controlled by Microsoft, and we cannot make any representations regarding the quality, safety, or suitability of their content. Please ensure you fully understand the risks before applying any recommendations.) 

    Microsoft Tech Community – Actively monitored by Microsoft Engineers and MVPs who can offer more targeted support. 

    These platforms are specifically designed for technical coding questions and will provide broader visibility along with more timely responses from experts. 

    Thank you again for your understanding and patience. Although my response may not resolve your issue immediately, I am here if you have any other questions. 


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.