Colin Legg
08-23-2005, 03:02 PM
Hi all,
I have a very straightforward procedure to print every worksheet within the active workbook. It works correctly all of the time except for when I use it on one particular workbook.... and I really can't work out why!!
The VBA code is this:
Dim wSt As Worksheet
For Each wSt In ActiveWorkbook.Worksheets
wSt.PrintOut
Next wSt
The error message I am getting is this:
Run-time error '1004': Method 'PrintOut' of object '_Worksheet' failed
Can anyone give me some hints as to why this is happening with one particular workbook? I'm sure I must be overlooking something very basic. If not then I can attach the workbook for you to look at.
Thanks
Colin
I have a very straightforward procedure to print every worksheet within the active workbook. It works correctly all of the time except for when I use it on one particular workbook.... and I really can't work out why!!
The VBA code is this:
Dim wSt As Worksheet
For Each wSt In ActiveWorkbook.Worksheets
wSt.PrintOut
Next wSt
The error message I am getting is this:
Run-time error '1004': Method 'PrintOut' of object '_Worksheet' failed
Can anyone give me some hints as to why this is happening with one particular workbook? I'm sure I must be overlooking something very basic. If not then I can attach the workbook for you to look at.
Thanks
Colin