Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error in code
I have the following code for Excel 2003:
Private Sub btnPrint1_Click() Sheets("CapeCod").Select ActiveSheet.Unprotect ActiveSheet.ChartObjects("Chart 1").Activate ActiveChart.ChartArea.Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True ActiveWindow.Visible = False Windows("FinancialProjections.xls").Activate ' It errors out on this statement Range("B2").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True Sheets("COSTS").Select End Sub I created this code through recording a macro. It is run from a button. Any ideas on what could be stopping it? The exact error message is.... Run time error 1004 Select method of range class failed. -- M. Shipp |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
error with code | Excel Discussion (Misc queries) | |||
Help with error code | Excel Programming | |||
Error Code 6 | Excel Programming | |||
How can I still go to the error-code after a On Error Goto? | Excel Programming | |||
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) | Excel Programming |