LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default print embedded multiple page OLE objects

Hi all,

We have a multiple page/worksheet excel file that uses a macro to print all
of the worksheets to a single pdf file. this works fine btw :)

the problem now is that i want to extend the excel file to include some OLE
word/pdf documents that can be printed using the same button. these OLD
objects will be multiple pages in length.

macro so far:

##################################################
Sub Print_PDF()
Application.ActivePrinter = "CutePDF Writer on CPW2:"

Sheets("DATA ENTRY & PRESENTATION SHEET").Select
Sheets("BRIEFING").Select False
Sheets("METHOD").Select False
Sheets("SHEET1").Select False
Sheets("RISK MATRIX").Select False
Sheets("BLANK RISK").Select False
Sheets("RISKS DATABASE").Select False

ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

End Sub
##################################################

now, i found this code:

##################################################
Dim wksWithWordDocs As Worksheet
Dim wordObject As OLEObject
Dim wordDocument As Word.Document

Set wksWithWordDocs = ThisWorkbook.Worksheets("Sheet1")
For Each wordObject In wksWithWordDocs.OLEObjects
wordObject.Activate
Set wordDocument = wordObject.Object
wordDocument.PrintOut
wordDocument.Close
Next wordObject
##################################################

it apparently will print out old objects but it doesnt work for me, even if
i set up a Reference to Microsoft Word 11.0 Object library in the VB editor.
i get a 'run-time error 1004 - unable to find object propert of the OLEObject
class'
with this line: Set wordDocument = wordObject.Object

any ideas?

thanks in advance peeps :)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I print multiple print areas on one page Leo18 Excel Discussion (Misc queries) 1 January 11th 10 07:28 PM
Embedded objects(?) Brad Excel Discussion (Misc queries) 2 September 18th 09 04:45 PM
Embedded Objects Pete[_3_] Excel Discussion (Misc queries) 2 January 18th 08 05:03 PM
How do I print a one page spreadsheet multiple time, each with its own page number? lhsallwasser Excel Discussion (Misc queries) 4 August 17th 05 03:00 PM
embedded objects John[_62_] Excel Programming 0 October 29th 03 08:05 PM


All times are GMT +1. The time now is 04:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"