I have a spread sheet that consolidates multiple worksheets into one. Then, the user sets the page breaks. Next, the user can hit a "PDF" button and it will export to pdf. It looks great - exactly as it does in excel. But, I cant quite seem to get the Word export to work.
When the "Word" button is clicked, it opens new word doc, pastes the print area from excel, and autofits to fit the window. Unfortunately, its not clean looking when I do this.
I would like to copy the print area and paste each page as a separate image one after the other
Any thoughts?
Current Code:
When the "Word" button is clicked, it opens new word doc, pastes the print area from excel, and autofits to fit the window. Unfortunately, its not clean looking when I do this.
I would like to copy the print area and paste each page as a separate image one after the other
Any thoughts?
Current Code:
Code:
Sub printer()
Const strRangeToCopy As String = "print_area"
Dim appWord As Object
Range(strRangeToCopy).Copy
'Copy Excel Table Range
On Error Resume Next
Set appWord = GetObject(, "Word.Application")
On Error GoTo 0
If appWord Is Nothing Then Set appWord = CreateObject("Word.Application")
With appWord
.Documents.Add
.Selection.Paste
.Visible = True
End With
ActiveDocument.Tables(1).AutoFitBehavior _
wdAutoFitWindow
End Sub