Runtime errror opening Word from Excel

CNorth

New Member
Joined
Jan 7, 2021
Messages
24
Office Version
  1. 365
Platform
  1. Windows
Hi

I can no longer open Word from Excel. I have been using a macro for some time with no issues but all of a sudden the procedure generates a runtime error/server execution failed (80080005) on the following line Set wrd = New word.Application

The Microsoft Word Object Library is selected under References. I have tried the code with and without Word open, I have have also tried late binding but the problem persists. Oddly, I can open Excel from Word. The code I am using to open Word from Excel is

VBA Code:
Sub openWord()

Dim wrd As word.Application
Set wrd = New word.Application
wrd.Documents.Add
wrd.Visible = True

End Sub
VBA Code:

Any ideas would be really appreciated.

Thanks

Caroline
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hi Caroline. Seems like your missing setting the doc to a variable. HTH. Dave
Code:
Dim wrd As word.Application, objDoc as object
Set wrd = New word.Application
Set objDoc = wrd.Documents.Add
wrd.Visible = True
 
Upvote 0
Thank you for responding. I’ve since realised a system upgrade has changed the security settings; when I run the code a pop up (non excel based) appears stating there could be a risk and to disable the macro. When I close it, the macro runs as normal.
 
Upvote 0

Forum statistics

Threads
1,224,034
Messages
6,176,001
Members
452,695
Latest member
Alhassan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top