M
michael.haight
I'm a novice VBA coder, but am trying to make this work. I have an
Excel workbook that contains 4 worksheets. The first worksheet is a
summary, and this is where I'd like to add a button to "Print All".
The remaining 3 worksheets each contain data as well as an embedded
Word document. I would like the "Print All" button to print both the
data from each sheet, as well as the embedded Word document from each.
I've put together the code below, but receive an error on the
"PrintOut" line.
Any help???
Thanks!
-Mike
Private Sub cmdPrintAll_Click()
Dim CurVis As Long
Dim sh As Worksheet
For Each sh In ActiveWorkbook.Worksheets
For i = 1 To ActiveSheet.OLEObjects.Count
ActiveSheet.OLEObjects(i).Activate
ActiveSheet.OLEObjects(i).Object.Application.PrintOut
Next i
Next sh
End Sub
Excel workbook that contains 4 worksheets. The first worksheet is a
summary, and this is where I'd like to add a button to "Print All".
The remaining 3 worksheets each contain data as well as an embedded
Word document. I would like the "Print All" button to print both the
data from each sheet, as well as the embedded Word document from each.
I've put together the code below, but receive an error on the
"PrintOut" line.
Any help???
Thanks!
-Mike
Private Sub cmdPrintAll_Click()
Dim CurVis As Long
Dim sh As Worksheet
For Each sh In ActiveWorkbook.Worksheets
For i = 1 To ActiveSheet.OLEObjects.Count
ActiveSheet.OLEObjects(i).Activate
ActiveSheet.OLEObjects(i).Object.Application.PrintOut
Next i
Next sh
End Sub