Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default PasteSpecial giving error #1004

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default PasteSpecial giving error #1004

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default PasteSpecial giving error #1004

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default PasteSpecial giving error #1004

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default PasteSpecial giving error #1004

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default PasteSpecial giving error #1004

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default PasteSpecial giving error #1004

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default PasteSpecial giving error #1004

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default PasteSpecial giving error #1004

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default PasteSpecial giving error #1004

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default PasteSpecial giving error #1004

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default PasteSpecial giving error #1004

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default PasteSpecial giving error #1004

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default PasteSpecial giving error #1004

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
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
Error 1004 - PasteSpecial failure Otto Moehrbach[_2_] Excel Programming 2 May 16th 08 08:01 PM
PasteSpecial Error 1004? DaveM Excel Discussion (Misc queries) 3 February 7th 08 02:41 PM
Runtime Error 1004 when trying to PasteSpecial Phil Davis Excel Discussion (Misc queries) 2 February 16th 06 10:02 PM
runtime error 1004 pastespecial method of range class failed dreamz[_29_] Excel Programming 5 February 3rd 06 02:57 PM
UpdateLink giving error 1004 DRK Excel Programming 5 September 15th 05 09:29 PM


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

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

About Us

"It's about Microsoft Excel"