Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default ActiveSheet.Paste error in XP

I've got a macro which works perfectly in Windows 2000 with Excel 2000 but
falls over in Windows XP Pro with Excel 2003.

It fails on ActiveSheet.Paste with an error message Run Time Error 1004 -
Application defined or object defined error.

Any ideas would be much appreciated

Thanks

The full code is:


Sheets("Data").Select
Range("A1:AJ15000").AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:= _
Range("AP1:AP2"), Unique:=False
Range("A1").Select

Range("A2:A15000,C2:C15000,E2:E15000,F2:f15000,G2: g15000,H2:h15000,I2:I15000").Select
Selection.Copy
Sheets("Signup Report").Select
Range("A2").Select
ActiveSheet.Paste
Sheets("Data").Select
Range("J2: J15000 , L2: L15000 , M2: M15000 , AG2: AG15000 , AI2:
AI15000 , O2: o15000 ").Select
Selection.Copy
Sheets("Signup Report").Select
Range("I2").Select
ActiveSheet.Paste

Dim frng As Range
Application.CutCopyMode = False
Range("H2").FormulaR1C1 = "=RC6+90"
Set frng = Range("h2:h" & Range("f65536").End(xlUp).Row)
frng.FillDown

Range("o2").FormulaR1C1 = "=Sum(RC11:RC14)"
Range("p2").FormulaR1C1 = "=ROUND(RC15*25%,2)"
Set frng = Range("o2:p" & Range("f65536").End(xlUp).Row)
frng.FillDown


Columns("j:p").Select
Selection.NumberFormat = "0.00"
Columns("e:i").Select
Selection.NumberFormat = "dd/mm/yyyy"
Columns("a:d").Select
Selection.Columns.AutoFit
Columns("e:p").Select
Selection.ColumnWidth = 11.5
Application.Calculation = xlCalculationAutomatic
Selection.Copy
Selection.PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
Range("a1").Select
end sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ActiveSheet.Paste error in XP

Sub AABBCC()
Dim shData As Worksheet
Dim shSign As Worksheet
Dim fRng As Range
Set shData = Sheets("Data")
Set shSign = Sheets("Signup Report")

shData.Range("A1:AJ15000").AdvancedFilter _
Action:=xlFilterInPlace, _
CriteriaRange:= _
shData.Range("AP1:AP2"), Unique:=False

sh.DataRange("A2:A15000,C2:C15000,E2:E15000," _
& "F2:f15000,G2:g15000,H2:h15000,I2:I15000").Cop y _
Destination:=shSign.Range("A2")

sh.Data.Range("J2: J15000,L2:L15000,M2:M15000" & _
",AG2:AG15000,AI2:AI15000,O2:O15000 ").Copy _
Destination:=shSign.Range("I2")


Application.CutCopyMode = False
sh.Sign.Range("H2").FormulaR1C1 = "=RC6+90"
Set fRng = shSign.Range("h2:h" & _
sh.Sign.Range("f65536").End(xlUp).Row)
fRng.FillDown

shSign.Range("o2").FormulaR1C1 = "=Sum(RC11:RC14)"
shSign.Range("p2").FormulaR1C1 = "=ROUND(RC15*25%,2)"
Set fRng = shSign.Range("o2:p" & _
shSign.Range("f65536").End(xlUp).Row)
fRng.FillDown

With shSign
.Columns("j:p").NumberFormat = "0.00"
.Columns("e:i").NumberFormat = "dd/mm/yyyy"
.Columns("a:d").Columns.AutoFit
Application.Calculation = xlCalculationAutomatic
With .Columns("e:p").ColumnWidth = 11.5
.Copy
.PasteSpecial Paste:=xlValues
End With
Application.CutCopyMode = False
End With
End Sub

Might work.

--
Regards,
Tom Ogilvy

"nospaminlich" wrote in message
...
I've got a macro which works perfectly in Windows 2000 with Excel 2000 but
falls over in Windows XP Pro with Excel 2003.

It fails on ActiveSheet.Paste with an error message Run Time Error 1004 -
Application defined or object defined error.

Any ideas would be much appreciated

Thanks

The full code is:


Sheets("Data").Select
Range("A1:AJ15000").AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:= _
Range("AP1:AP2"), Unique:=False
Range("A1").Select


Range("A2:A15000,C2:C15000,E2:E15000,F2:f15000,G2: g15000,H2:h15000,I2:I15000
").Select
Selection.Copy
Sheets("Signup Report").Select
Range("A2").Select
ActiveSheet.Paste
Sheets("Data").Select
Range("J2: J15000 , L2: L15000 , M2: M15000 , AG2: AG15000 , AI2:
AI15000 , O2: o15000 ").Select
Selection.Copy
Sheets("Signup Report").Select
Range("I2").Select
ActiveSheet.Paste

Dim frng As Range
Application.CutCopyMode = False
Range("H2").FormulaR1C1 = "=RC6+90"
Set frng = Range("h2:h" & Range("f65536").End(xlUp).Row)
frng.FillDown

Range("o2").FormulaR1C1 = "=Sum(RC11:RC14)"
Range("p2").FormulaR1C1 = "=ROUND(RC15*25%,2)"
Set frng = Range("o2:p" & Range("f65536").End(xlUp).Row)
frng.FillDown


Columns("j:p").Select
Selection.NumberFormat = "0.00"
Columns("e:i").Select
Selection.NumberFormat = "dd/mm/yyyy"
Columns("a:d").Select
Selection.Columns.AutoFit
Columns("e:p").Select
Selection.ColumnWidth = 11.5
Application.Calculation = xlCalculationAutomatic
Selection.Copy
Selection.PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
Range("a1").Select
end sub



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveSheet.Paste (error) Puzzled Excel Worksheet Functions 1 August 2nd 07 06:18 PM
ActiveSheet.Paste - Error help? dk_ Excel Discussion (Misc queries) 4 November 20th 06 12:27 AM
XP activesheet.paste error on VMware servers pcora Excel Programming 1 September 28th 04 11:25 PM
ActiveSheet.Paste error Ron de Bruin Excel Programming 0 July 25th 03 12:39 PM


All times are GMT +1. The time now is 11:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"