1

I manage an Access database that generates Word documents. I'm using late binding to create a new instance of MS Word, and it's been working fine for years. We recently upgraded to Office 365, but we also have Office 2010 installed in order to support several hundred InfoPath forms.

Within the automation, we create a Word document and fill in data. The process of creating a new MS Word app object is taking users an extremely long time, anywhere between 30 and 55 seconds. Here are a few tests I’ve run with run times. The code was run in Access.

  1. Set wAP = CreateObject(“Word.Application”): 40 seconds
  2. Set wAP = New Word.Application: 40 seconds
  3. Set xlAP = CreateObject(“Excel.Application”): 2 seconds

Using the same late binding technique to create an Excel object takes the normal amount of time, which leads me to believe there’s an issue with MS Word. Opening Word, Excel, etc., normally (from the desktop shortcut to the exe) does not result in this slowness. On my PC, I have Office 365 ProPlus and Office 2013 InfoPath installed. The same lines of code from above run in about 2 seconds.

Here are a couple things I tried on the user’s session with virtually no difference in elapsed time:

  • Disabled all add-ins
  • Turned off auto-recovery

We've tried reinstalling Office 365, repairing Office 365, and repairing Office 2010. The only solution we've found is removing Office 2010 completely, but unfortunately we need to keep it installed to support the InfoPath forms. We cannot install InfoPath 2013 on the users' machine because it's not compatible on a terminal server setup.

Any ideas why this slowness is occurring? Thanks in advance.

Cindy Meister
  • 23,572
  • 20
  • 33
  • 43
nateropes
  • 11
  • 1
  • 2
    One possibility would be that Word is re-registering itself everytime the other version is started. After Word 2010 has run, for example, Word 365 will re-write its registry entries when it's started. Then when Word 2010 is run, it re-registers, etc. These "newer" versions of Word (unlike very early ones) are *not* designed to work in-parallel on a single installation. They *can*, but it's not officially supported by MS and MS makes no particular effort to ensure a "good experience". One reason for this is the "DLL-Hell" (things between versions getting mixed up) in the older configurations. – Cindy Meister Jan 07 '20 at 21:29
  • I have no idea, it is not normal. Try using `GetObject` if possible. You can use it to attach to a running `Word.Application`. You can also use it to open files regardless if they are already opened. [The other way not relevant here is to open a file in a specified program]. This may prevent creating processes by reusing existing ones. 1 does late binding and 2 early binding but you would need to call lots of functions per second for that to make a difference. Your time delay is n process start. COM servers start (for word) `winword.exe /a` this starts it without any customisations. –  Jan 08 '20 at 04:40

0 Answers0