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

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
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,223,626
Messages
6,173,415
Members
452,514
Latest member
cjkelly15

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