Hello guys,
I want to write an excel macro that opens up sheets of word in directories per request and prints them out
I already have a full path created for each file, so all i really need to do is:
1) Open the word document with specific name
2) Print out only page 2, this i can achieve with something like: objDoc.PrintOut
Current code:
This should create the object and open it up, but i get the runtime error 429, activex component can't create object.
My references contain: Microsoft DAO 3.6 Object Library and Microsoft ActiveX Data Objects 6.1 Library
What am i missing?
I want to write an excel macro that opens up sheets of word in directories per request and prints them out
I already have a full path created for each file, so all i really need to do is:
1) Open the word document with specific name
2) Print out only page 2, this i can achieve with something like: objDoc.PrintOut
Current code:
Code:
Dim objWord
Dim objDoc
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Open("C:\Documents\test.docx")
objWord.Visible = True
This should create the object and open it up, but i get the runtime error 429, activex component can't create object.
My references contain: Microsoft DAO 3.6 Object Library and Microsoft ActiveX Data Objects 6.1 Library
What am i missing?