Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel 2003 "bug"
I have an Excel vba program that works correctly in Excel
97, 2000 and 2002, but not in 2003. A basic command of "Range("B1").select" followed by "activesheet.paste" fails with the error... Run-time error '1004': Paste method of worksheet class failed Here is the code that leads up to the error... Sheets("Live").Select Range("A65536").Select Selection.End(xlUp).Select Rows("2:" & ActiveCell.Row).Select Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Key2:=Range("C2") _ , Order2:=xlAscending, Header:=xlNo, OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom Range("A65536").Select Selection.End(xlUp).Select Last_Row_Number = ActiveCell.Row Range("J2") = "=IF(OR(A2<A1,C2<C1),E2,E2+J1)" Range("K2") = "=IF(AND(A2=A3,C2=C3),0,J2)" Range("J2:K2").Copy Range("J2:K" & Last_Row_Number).Select ActiveSheet.Paste Sheets("Live").Select Columns("K:K").Select Selection.AutoFilter Selection.AutoFilter Field:=1, Criteria1:="<0", Operator:=xlAnd Columns("A:A").Select Selection.Copy Sheets("Live_byDay").Select 'the code fails here by not being able to select a cell and then paste the contents of column A copied from another sheet Range("B1").Select ActiveSheet.Paste Application.CutCopyMode = False The code works correctly in previous versions of Excel, so I'm going to guess that it is a "bug". Does anyone know whether this is the case? Or have a solution? I have another Excel program where similar lines of code creates the same error (but only in Excel 2003). |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2003: Conditional Formatting using "MIN" & "MAX" function | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
How to entre a "pattern" in a column chart? "used to be in 2003" | Excel Discussion (Misc queries) | |||
In Excel 2003 is there a way to prevent "Save As" and "Print"? | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel |