Print word document from excel

Status
Not open for further replies.

littleguy1810

New Member
Joined
Aug 21, 2014
Messages
40
Hi

A great guy has been helping me with this code(Macropod) could someone help me with this as he is offline, ?I get an error msg when trying to run it. Error code 91? Object variable or with block variable not set.

Thanks





Code:
Dim wdApp As New Word.Application, wdDoc As Word.DocumentSet wdDoc = wdApp.Documents.Open(Filename:=ActiveWorkbook.Path & "T:\Quality Management System\Section 7 Personnel\07.004 Animal Feed Jan16.docx", _
  ReadOnly:=True, AddToRecentFiles:=False)
With wdDoc
  .PrintOut
  .Close , False
End With
wdApp.Quit
Set wdDoc = Nothing: Set wdApp = Nothing
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Did the open method actually open the file (" wdApp.Documents.Open(Filename:=ActiveWorkbook.Path & "T:\Qu....")? I'm asking the question because it seems odd to have a path followed by a drive letter (ActiveWorkbook.Path & "T:\...").
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,213,527
Messages
6,114,142
Members
448,551
Latest member
Sienna de Souza

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