Trying to open Word Doc with Excel VBA

BadgerRoad

Active Member
Joined
Dec 2, 2005
Messages
299
Office Version
  1. 365
Platform
  1. Windows
I am trying to open a Word document with vba. Word will open but I'm getting an error on the Documents.Open line that says "Object Required". I've tried doing this many different ways but I keep getting the same error.
Any suggestions would be appreciated.

VBA Code:
Sub CreateWordApp()

Dim WordApp As Word.Application
Set WordApp = New Word.Application
WordApp.Visible = True
WordApp.Activate
'WordApp.Documents.Open ThisWorkbook.Path & "/" & "Mail merge list-online labels 875.docx"

WordDoc.Documents.Open "H:\Mail merge list-online labels 875.docx"

End Sub
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
It's WordApp.Documents.Open not WordDoc.Documents.Open
 
Upvote 0
I don't know how long I stared at this and couldn't see my stupid mistake!
Thank you.
 
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,953
Members
449,198
Latest member
MhammadishaqKhan

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