Pinting excel sheets + embedded word document

DvdV

New Member
Joined
Nov 8, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi,
I keep having problems with printing an excel file + the embedded word document. The excel file is about 15 pages, the embedded Word document about 10 pages. The problem is that from the embeddeb document only the first page is visible and printed.
How can I make sure the other 9 pages from the word document are included in the print version?

(excuse my bad English, it is not my mother-language)
 

Some videos you may like

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
19,403
The following code assumes that...

1) the workbook containing the embedded Word document is the active workbook

2) Sheet1 contains the embedded Word document

3) the embedded Word document is named Object 1

Here's the code...

VBA Code:
    Dim embeddedWordDocument As OLEObject
    Set embeddedWordDocument = ActiveWorkbook.Worksheets("Sheet1").OLEObjects("Object 1") 'change the workbook, sheet, and object names accordingly
  
    embeddedWordDocument.Verb xlVerbOpen
  
    Dim wordDocument As Object
    Set wordDocument = embeddedWordDocument.Object
  
    With wordDocument
        .PrintOut 'see link below for the optional arguments available
        .Close
    End With

See the following reference page for arguments available for the PrintOut method of the Document object...

Document.PrintOut method (Word)

Hope this helps!
 

DvdV

New Member
Joined
Nov 8, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Thamk you Domimic.
Sadly this doesn't help me beacause I can't add a macro to the file. The excel-file is protected for adding macros. This prtection can't be lifted because the file is used by thousands of people.
 

Watch MrExcel Video

Forum statistics

Threads
1,119,224
Messages
5,576,830
Members
412,749
Latest member
BlakeVanderMeer
Top