Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
name of the activesheet | Excel Programming | |||
problem using ActiveSheet in VB sub | Excel Programming | |||
ActiveSheet.Name? | Excel Programming | |||
ActiveSheet | Excel Programming | |||
ActiveSheet | Excel Programming |