ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ActiveSheet.PrintOut - problem (https://www.excelbanter.com/excel-programming/292033-activesheet-printout-problem.html)

Derek T.

ActiveSheet.PrintOut - problem
 
Hello,
Someone created an excel file with some fancy
stuff. On menu like window there are buttons
for printing reports. When I try to use them, all
I get is an error message
"Run-time error '1004'
Printout method of worksheet class failed"
if I try to debug it points to "ActiveSheet.PrintOut"
line.
Any idea how to fix it?
Thank you



mike

ActiveSheet.PrintOut - problem
 
There are probably a number of possibilities for this
depending on what the code is doing before the PrintOut
statement.
For example, it is possible for no sheet to be Active.
Place the following line before the PrintOut line:
msgbox ActiveSheet.Name

You may need to post more information about the routine.

-----Original Message-----
Hello,
Someone created an excel file with some fancy
stuff. On menu like window there are buttons
for printing reports. When I try to use them, all
I get is an error message
"Run-time error '1004'
Printout method of worksheet class failed"
if I try to debug it points to "ActiveSheet.PrintOut"
line.
Any idea how to fix it?
Thank you


.


Derek T.

ActiveSheet.PrintOut - problem
 
Thanks Mike,
Whole menu starts with a dialog window, which
contains some buttons. Those buttons have macros assigned. If I run just
macro, everything is fine.
macro sample:
Sub Cdncust_report()
'Application.ExecuteExcel4Macro String:="Report Manager"
'Application.ExecuteExcel4Macro String:="Report Manager"
'Application.ExecuteExcel4Macro String:=" REPORT.PRINT(""Cdn Customer
Package"",1)"
Sheets("Project Information").Activate
ActiveSheet.PrintOut
Sheets("Design Basis [Cdn]").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Scrubber Specification [Cdn]").Activate
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Costs [$Cdn]").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Worksheets("Project Information").Activate

End Sub
I created new Dialog window (Right click on the worksheet tab at the bottom,
insert, Dialog)
added one button and assign simple macro:
"Application.Goto Reference:="Reports!R14C5" "
still wouldn't work, I got " Method 'Goto' of object '_Application"
failed

????
Derek T.


"Mike" wrote in message
...
There are probably a number of possibilities for this
depending on what the code is doing before the PrintOut
statement.
For example, it is possible for no sheet to be Active.
Place the following line before the PrintOut line:
msgbox ActiveSheet.Name

You may need to post more information about the routine.

-----Original Message-----
Hello,
Someone created an excel file with some fancy
stuff. On menu like window there are buttons
for printing reports. When I try to use them, all
I get is an error message
"Run-time error '1004'
Printout method of worksheet class failed"
if I try to debug it points to "ActiveSheet.PrintOut"
line.
Any idea how to fix it?
Thank you


.




Derek T.

ActiveSheet.PrintOut - problem
 
Thanks Mike,
Whole menu starts with a dialog window, which
contains some buttons. Those buttons have macros assigned. If I run just
macro, everything is fine.
macro sample:
Sub Cdncust_report()
'Application.ExecuteExcel4Macro String:="Report Manager"
'Application.ExecuteExcel4Macro String:="Report Manager"
'Application.ExecuteExcel4Macro String:=" REPORT.PRINT(""Cdn Customer
Package"",1)"
Sheets("Project Information").Activate
ActiveSheet.PrintOut
Sheets("Design Basis [Cdn]").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Scrubber Specification [Cdn]").Activate
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Costs [$Cdn]").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Worksheets("Project Information").Activate

End Sub
I created new Dialog window (Right click on the worksheet tab at the bottom,
insert, Dialog)
added one button and assign simple macro:
"Application.Goto Reference:="Reports!R14C5" "
still wouldn't work, I got " Method 'Goto' of object '_Application"
failed

????
Derek T.



"Mike" wrote in message
...
There are probably a number of possibilities for this
depending on what the code is doing before the PrintOut
statement.
For example, it is possible for no sheet to be Active.
Place the following line before the PrintOut line:
msgbox ActiveSheet.Name

You may need to post more information about the routine.

-----Original Message-----
Hello,
Someone created an excel file with some fancy
stuff. On menu like window there are buttons
for printing reports. When I try to use them, all
I get is an error message
"Run-time error '1004'
Printout method of worksheet class failed"
if I try to debug it points to "ActiveSheet.PrintOut"
line.
Any idea how to fix it?
Thank you


.





All times are GMT +1. The time now is 11:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com