7
votes

I'm running into the following error when executing the following line from VBA (Access):

Set wd = CreateObject("Word.Application")

Imgur

I found the following link, but did not find it useful: http://support.microsoft.com/kb/828550

Things I've Tried


  • Repair installation of Office from Control Panel > Programs and Features
  • Uninstall MS Word, re-install
  • Tried Dim wd As Object instead of Dim wd as Word.Application
  • Manually run Word.
  • Run winword.exe /RegServer in Administrator command prompt. Did not run silently, merely opened Word.
  • Examine the LocalServer32 key under the CLSID {000209FF-0000-0000-C000-000000000046}. Initially was missing. After re-install Word, the CLDID was there but LocalServer32 key is missing.
  • Run winword.exe /automation. Merely starts Word.
  • Run winword.exe as Administrator.
  • Run access.exe as Administrator.

Relevant (maybe)


  • Windows 8 x64
  • Office 2007
  • C:\Program Files (x86)\Microsoft Office\Office12
  • A preview version of Office 2010 was pre-installed.
  • Launching Excel works with automation and VBA.
  • asycfilt.dll file version: 6.2.9200.16384, date: 7/25/2012 11:05pm
  • oleaut32.dll file version: 6.2.9200.16384, date: 7/25/2012 11:06pm
  • olepro32.dll missing
  • stdole2.tlb no file version, date: 7/25/2012 10:34pm
  • McAffee anti-virus
1
sorry, now I see that in your question :) - Kazimierz Jawor
Can you not use "Set wd = New Word.Application" either? - dennythecoder
What happens if you open up Word first and then run `Set wd = GetObject(, "Word.Application")? - CuberChase
The code you have is all good. Unfortunately I think it maybe a system problem and you have taken all the reasonable steps to fix it (short of a reformat!). I'm sure if you test the code on another computer it will work ok. - CuberChase
I have the exact same problem as @Chloe. I am running Office 2007 on 64-bit Windows 7. I forced my code to run by including "on error resume next" and that seemed to make my code work. - Avinash Bhat

1 Answers

2
votes

Examine the LocalServer32 key under the CLSID {000209FF-0000-0000-C000-000000000046}. Initially was missing. After re-install Word, the CLDID was there but LocalServer32 key is missing

So Word is unable to register properly because you have a system issue.
As that you've tried most or all of the reasonable steps, your next step is to reinstall Windows.

Or you could try manually registering it by duplicating all the relevant keys from a different machine. But that probably wouldn't solve the problem.

Super User might be a better place to ask about installation and Windows registry issues.