Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a weird problem. I've created a workbook that dozens of sales people use. One laptop, which is the exact same configuration as all of the others, is having a problem running my code. With Sheets("Order") .Range("A2:V200").Delete Sheets("OrderPrep").Range("B3:U29").Copy .Range("B1").PasteSpecial xlPasteValues .Range("B1").PasteSpecial xlPasteFormats End With It's not this specific piece of code; it happens with EVERY pastespecial that this laptop runs. I can't figure it out! any suggestions? thx |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Your code works. Make sure the tab names are spelled correctly.
-- Gary''s Student - gsnu200802 " wrote: Hi, I have a weird problem. I've created a workbook that dozens of sales people use. One laptop, which is the exact same configuration as all of the others, is having a problem running my code. With Sheets("Order") .Range("A2:V200").Delete Sheets("OrderPrep").Range("B3:U29").Copy .Range("B1").PasteSpecial xlPasteValues .Range("B1").PasteSpecial xlPasteFormats End With It's not this specific piece of code; it happens with EVERY pastespecial that this laptop runs. I can't figure it out! any suggestions? thx |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
works here, i know you can get a 1004 error if the sheet's protected, but you
say it runs on other pc's. -- Gary wrote in message ... Hi, I have a weird problem. I've created a workbook that dozens of sales people use. One laptop, which is the exact same configuration as all of the others, is having a problem running my code. With Sheets("Order") .Range("A2:V200").Delete Sheets("OrderPrep").Range("B3:U29").Copy .Range("B1").PasteSpecial xlPasteValues .Range("B1").PasteSpecial xlPasteFormats End With It's not this specific piece of code; it happens with EVERY pastespecial that this laptop runs. I can't figure it out! any suggestions? thx |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sep 4, 12:29*pm, Gary''s Student
wrote: Your code works. *Make sure the tab names are spelled correctly. -- Gary''s Student - gsnu200802 " wrote: Hi, I have a weird problem. *I've created a workbook that dozens of sales people use. *One laptop, which is the exact same configuration as all of the others, is having a problem running my code. * * With Sheets("Order") * * * * .Range("A2:V200").Delete * * * * Sheets("OrderPrep").Range("B3:U29").Copy * * * * .Range("B1").PasteSpecial xlPasteValues * * * * .Range("B1").PasteSpecial xlPasteFormats * * End With It's not this specific piece of code; it happens with EVERY pastespecial that this laptop runs. *I can't figure it out! any suggestions? thx- Hide quoted text - - Show quoted text - It's nothign wrong with the workbook, it's gotta be a setting somewhere. It works fine on 11 other computers. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
what's the text of the 1004 error?
-- Gary wrote in message ... On Sep 4, 12:29 pm, Gary''s Student wrote: Your code works. Make sure the tab names are spelled correctly. -- Gary''s Student - gsnu200802 " wrote: Hi, I have a weird problem. I've created a workbook that dozens of sales people use. One laptop, which is the exact same configuration as all of the others, is having a problem running my code. With Sheets("Order") .Range("A2:V200").Delete Sheets("OrderPrep").Range("B3:U29").Copy .Range("B1").PasteSpecial xlPasteValues .Range("B1").PasteSpecial xlPasteFormats End With It's not this specific piece of code; it happens with EVERY pastespecial that this laptop runs. I can't figure it out! any suggestions? thx- Hide quoted text - - Show quoted text - It's nothign wrong with the workbook, it's gotta be a setting somewhere. It works fine on 11 other computers. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Might be that the personal.xls on one of the computers is somehow screwing
things up?? -- Gary''s Student - gsnu200802 "Gary Keramidas" wrote: works here, i know you can get a 1004 error if the sheet's protected, but you say it runs on other pc's. -- Gary wrote in message ... Hi, I have a weird problem. I've created a workbook that dozens of sales people use. One laptop, which is the exact same configuration as all of the others, is having a problem running my code. With Sheets("Order") .Range("A2:V200").Delete Sheets("OrderPrep").Range("B3:U29").Copy .Range("B1").PasteSpecial xlPasteValues .Range("B1").PasteSpecial xlPasteFormats End With It's not this specific piece of code; it happens with EVERY pastespecial that this laptop runs. I can't figure it out! any suggestions? thx |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sep 4, 1:00*pm, "Gary Keramidas" <GKeramidasATmsn.com wrote:
what's the text of the 1004 error? -- Gary wrote in message ... On Sep 4, 12:29 pm, Gary''s Student wrote: Your code works. Make sure the tab names are spelled correctly. -- Gary''s Student - gsnu200802 " wrote: Hi, I have a weird problem. I've created a workbook that dozens of sales people use. One laptop, which is the exact same configuration as all of the others, is having a problem running my code. With Sheets("Order") .Range("A2:V200").Delete Sheets("OrderPrep").Range("B3:U29").Copy .Range("B1").PasteSpecial xlPasteValues .Range("B1").PasteSpecial xlPasteFormats End With It's not this specific piece of code; it happens with EVERY pastespecial that this laptop runs. I can't figure it out! any suggestions? thx- Hide quoted text - - Show quoted text - It's nothign wrong with the workbook, it's gotta be a setting somewhere. *It works fine on 11 other computers.- Hide quoted text - - Show quoted text - "Error #1004: Merged Cells must be identically sized" |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sep 4, 1:08*pm, Gary''s Student
wrote: Might be that the personal.xls on one of the computers is somehow screwing things up?? -- Gary''s Student - gsnu200802 "Gary Keramidas" wrote: works here, i know you can get a 1004 error if the sheet's protected, but you say it runs on other pc's. -- Gary wrote in message .... Hi, I have a weird problem. *I've created a workbook that dozens of sales people use. *One laptop, which is the exact same configuration as all of the others, is having a problem running my code. * *With Sheets("Order") * * * *.Range("A2:V200").Delete * * * *Sheets("OrderPrep").Range("B3:U29").Copy * * * *.Range("B1").PasteSpecial xlPasteValues * * * *.Range("B1").PasteSpecial xlPasteFormats * *End With It's not this specific piece of code; it happens with EVERY pastespecial that this laptop runs. *I can't figure it out! any suggestions? thx- Hide quoted text - - Show quoted text - Just chcked and there's nothing unusual being loaded from the XLSTARTUP, etc folders. Also, I tried to run the code as if I was doing it manually (selected some cells, went to a new sheet, edit, paste special) and it gave me the same error. So it's most definately not the code but rather something in that particular instance of excel. |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
there must be a merged cell on the order sheet. put a breakpoint on this line
Sheets("OrderPrep").Range("B3:U29").Copy and see if there is a merged cell in the are you're trying to copy to. -- Gary wrote in message ... On Sep 4, 1:08 pm, Gary''s Student wrote: Might be that the personal.xls on one of the computers is somehow screwing things up?? -- Gary''s Student - gsnu200802 "Gary Keramidas" wrote: works here, i know you can get a 1004 error if the sheet's protected, but you say it runs on other pc's. -- Gary wrote in message ... Hi, I have a weird problem. I've created a workbook that dozens of sales people use. One laptop, which is the exact same configuration as all of the others, is having a problem running my code. With Sheets("Order") .Range("A2:V200").Delete Sheets("OrderPrep").Range("B3:U29").Copy .Range("B1").PasteSpecial xlPasteValues .Range("B1").PasteSpecial xlPasteFormats End With It's not this specific piece of code; it happens with EVERY pastespecial that this laptop runs. I can't figure it out! any suggestions? thx- Hide quoted text - - Show quoted text - Just chcked and there's nothing unusual being loaded from the XLSTARTUP, etc folders. Also, I tried to run the code as if I was doing it manually (selected some cells, went to a new sheet, edit, paste special) and it gave me the same error. So it's most definately not the code but rather something in that particular instance of excel. |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
or try this
.Range("A2:V200").Clear instead of ..Range("A2:V200").Delete -- Gary wrote in message ... On Sep 4, 1:08 pm, Gary''s Student wrote: Might be that the personal.xls on one of the computers is somehow screwing things up?? -- Gary''s Student - gsnu200802 "Gary Keramidas" wrote: works here, i know you can get a 1004 error if the sheet's protected, but you say it runs on other pc's. -- Gary wrote in message ... Hi, I have a weird problem. I've created a workbook that dozens of sales people use. One laptop, which is the exact same configuration as all of the others, is having a problem running my code. With Sheets("Order") .Range("A2:V200").Delete Sheets("OrderPrep").Range("B3:U29").Copy .Range("B1").PasteSpecial xlPasteValues .Range("B1").PasteSpecial xlPasteFormats End With It's not this specific piece of code; it happens with EVERY pastespecial that this laptop runs. I can't figure it out! any suggestions? thx- Hide quoted text - - Show quoted text - Just chcked and there's nothing unusual being loaded from the XLSTARTUP, etc folders. Also, I tried to run the code as if I was doing it manually (selected some cells, went to a new sheet, edit, paste special) and it gave me the same error. So it's most definately not the code but rather something in that particular instance of excel. |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sep 4, 2:30*pm, "Gary Keramidas" <GKeramidasATmsn.com wrote:
or try this *.Range("A2:V200").Clear instead of .Range("A2:V200").Delete -- Gary wrote in message ... On Sep 4, 1:08 pm, Gary''s Student wrote: Might be that the personal.xls on one of the computers is somehow screwing things up?? -- Gary''s Student - gsnu200802 "Gary Keramidas" wrote: works here, i know you can get a 1004 error if the sheet's protected, but you say it runs on other pc's. -- Gary wrote in message .... Hi, I have a weird problem. I've created a workbook that dozens of sales people use. One laptop, which is the exact same configuration as all of the others, is having a problem running my code. With Sheets("Order") .Range("A2:V200").Delete Sheets("OrderPrep").Range("B3:U29").Copy .Range("B1").PasteSpecial xlPasteValues .Range("B1").PasteSpecial xlPasteFormats End With It's not this specific piece of code; it happens with EVERY pastespecial that this laptop runs. I can't figure it out! any suggestions? thx- Hide quoted text - - Show quoted text - Just chcked and there's nothing unusual being loaded from the XLSTARTUP, etc folders. Also, I tried to run the code as if I was doing it manually (selected some cells, went to a new sheet, edit, paste special) and it gave me the same error. *So it's most definately not the code but rather something in that particular instance of excel.- Hide quoted text - - Show quoted text - I fixed it. The solution is simple, the reason who the hell knows. Instead of using PasteSpecial, I just combined it into one command with Sheets("OrderPrep") ..Range("B3:U29").Copy .Range("B1") end with |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sep 4, 2:42*pm, wrote:
On Sep 4, 2:30*pm, "Gary Keramidas" <GKeramidasATmsn.com wrote: or try this *.Range("A2:V200").Clear instead of .Range("A2:V200").Delete -- Gary wrote in message ... On Sep 4, 1:08 pm, Gary''s Student wrote: Might be that the personal.xls on one of the computers is somehow screwing things up?? -- Gary''s Student - gsnu200802 "Gary Keramidas" wrote: works here, i know you can get a 1004 error if the sheet's protected, but you say it runs on other pc's. -- Gary wrote in message ... Hi, I have a weird problem. I've created a workbook that dozens of sales people use. One laptop, which is the exact same configuration as all of the others, is having a problem running my code. With Sheets("Order") .Range("A2:V200").Delete Sheets("OrderPrep").Range("B3:U29").Copy .Range("B1").PasteSpecial xlPasteValues .Range("B1").PasteSpecial xlPasteFormats End With It's not this specific piece of code; it happens with EVERY pastespecial that this laptop runs. I can't figure it out! any suggestions? thx- Hide quoted text - - Show quoted text - Just chcked and there's nothing unusual being loaded from the XLSTARTUP, etc folders. Also, I tried to run the code as if I was doing it manually (selected some cells, went to a new sheet, edit, paste special) and it gave me the same error. *So it's most definately not the code but rather something in that particular instance of excel.- Hide quoted text - - Show quoted text - I fixed it. *The solution is simple, the reason who the hell knows. Instead of using PasteSpecial, I just combined it into one command with Sheets("OrderPrep") .Range("B3:U29").Copy .Range("B1") end with- Hide quoted text - - Show quoted text - I'd like to re-open this thread... My solution above isn't good. Using the .Copy method with the destination passed along will change references and that's not cool, as I need it to copy the values only. So...Does anybody have any idea why a PasteSpecial would cause erro 1004 "merged cells must be identically sized" on one instance of excel, but not another? thx |
#13
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
see if this, at least, works without errors.
Sub test() With Sheets("Order") .Range("A2:V200").Delete With Sheets("OrderPrep").Range("B3:U29") .MergeCells = False .Copy End With .Range("B1").PasteSpecial xlPasteValues .Range("B1").PasteSpecial xlPasteFormats End With End Sub -- Gary wrote in message ... On Sep 4, 2:42 pm, wrote: On Sep 4, 2:30 pm, "Gary Keramidas" <GKeramidasATmsn.com wrote: or try this .Range("A2:V200").Clear instead of .Range("A2:V200").Delete -- Gary wrote in message ... On Sep 4, 1:08 pm, Gary''s Student wrote: Might be that the personal.xls on one of the computers is somehow screwing things up?? -- Gary''s Student - gsnu200802 "Gary Keramidas" wrote: works here, i know you can get a 1004 error if the sheet's protected, but you say it runs on other pc's. -- Gary wrote in message ... Hi, I have a weird problem. I've created a workbook that dozens of sales people use. One laptop, which is the exact same configuration as all of the others, is having a problem running my code. With Sheets("Order") .Range("A2:V200").Delete Sheets("OrderPrep").Range("B3:U29").Copy .Range("B1").PasteSpecial xlPasteValues .Range("B1").PasteSpecial xlPasteFormats End With It's not this specific piece of code; it happens with EVERY pastespecial that this laptop runs. I can't figure it out! any suggestions? thx- Hide quoted text - - Show quoted text - Just chcked and there's nothing unusual being loaded from the XLSTARTUP, etc folders. Also, I tried to run the code as if I was doing it manually (selected some cells, went to a new sheet, edit, paste special) and it gave me the same error. So it's most definately not the code but rather something in that particular instance of excel.- Hide quoted text - - Show quoted text - I fixed it. The solution is simple, the reason who the hell knows. Instead of using PasteSpecial, I just combined it into one command with Sheets("OrderPrep") .Range("B3:U29").Copy .Range("B1") end with- Hide quoted text - - Show quoted text - I'd like to re-open this thread... My solution above isn't good. Using the .Copy method with the destination passed along will change references and that's not cool, as I need it to copy the values only. So...Does anybody have any idea why a PasteSpecial would cause erro 1004 "merged cells must be identically sized" on one instance of excel, but not another? thx |
#14
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sep 5, 2:46*pm, "Gary Keramidas" <GKeramidasATmsn.com wrote:
see if this, at least, works without errors. Sub test() * * * With Sheets("Order") * * * * * * .Range("A2:V200").Delete * * * * * * With Sheets("OrderPrep").Range("B3:U29") * * * * * * * * * .MergeCells = False * * * * * * * * * .Copy * * * * * * End With * * * * * * .Range("B1").PasteSpecial xlPasteValues * * * * * * .Range("B1").PasteSpecial xlPasteFormats * * * End With End Sub -- Gary wrote in message ... On Sep 4, 2:42 pm, wrote: On Sep 4, 2:30 pm, "Gary Keramidas" <GKeramidasATmsn.com wrote: or try this .Range("A2:V200").Clear instead of .Range("A2:V200").Delete -- Gary wrote in message .... On Sep 4, 1:08 pm, Gary''s Student wrote: Might be that the personal.xls on one of the computers is somehow screwing things up?? -- Gary''s Student - gsnu200802 "Gary Keramidas" wrote: works here, i know you can get a 1004 error if the sheet's protected, but you say it runs on other pc's. -- Gary wrote in message ... Hi, I have a weird problem. I've created a workbook that dozens of sales people use. One laptop, which is the exact same configuration as all of the others, is having a problem running my code. With Sheets("Order") .Range("A2:V200").Delete Sheets("OrderPrep").Range("B3:U29").Copy .Range("B1").PasteSpecial xlPasteValues .Range("B1").PasteSpecial xlPasteFormats End With It's not this specific piece of code; it happens with EVERY pastespecial that this laptop runs. I can't figure it out! any suggestions? thx- Hide quoted text - - Show quoted text - Just chcked and there's nothing unusual being loaded from the XLSTARTUP, etc folders. Also, I tried to run the code as if I was doing it manually (selected some cells, went to a new sheet, edit, paste special) and it gave me the same error. So it's most definately not the code but rather something in that particular instance of excel.- Hide quoted text - - Show quoted text - I fixed it. The solution is simple, the reason who the hell knows. Instead of using PasteSpecial, I just combined it into one command with Sheets("OrderPrep") .Range("B3:U29").Copy .Range("B1") end with- Hide quoted text - - Show quoted text - I'd like to re-open this thread... My solution above isn't good. *Using the .Copy method with the destination passed along will change references and that's not cool, as I need it to copy the values only. So...Does anybody have any idea why a PasteSpecial would cause erro 1004 "merged cells must be identically sized" on one instance of excel, but not another? thx- Hide quoted text - - Show quoted text - It didn't work. However, I do have something interesting to report. When I run that code in a new book, it works. When I put that code into the existing workbook, it fails. That means it's something to do specifically with the laptop AND the workbook. Now I'm even more lost. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error 1004 - PasteSpecial failure | Excel Programming | |||
PasteSpecial Error 1004? | Excel Discussion (Misc queries) | |||
Runtime Error 1004 when trying to PasteSpecial | Excel Discussion (Misc queries) | |||
runtime error 1004 pastespecial method of range class failed | Excel Programming | |||
UpdateLink giving error 1004 | Excel Programming |