Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 1004 - Move Method of Worksheet Class Failed

I have a pretty lengthy single module in an excel file which runs fine
when the input file consists of approximately 8,000 or less records.
However, if the input file has 9,000 records or so then the macro
fails at a point when it is trying to move the worksheet from the
input file (a .txt file which is read in as pipe-delimitted and then
parsed) to another excel file which takes the input file data and
performs additional parsing....etc. etc.

I have seen lots of discussion regarding 1004 error messages, but not
anything related to erros associated with what I am experiencing which
is definitely tied to the number of rows from the original text file.

Currently, I am just breaking the input file into 2 and running the
process twice. I'm hoping there is a better solution?

Any ideas?

Thanks in advance for your help.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 1004 - Move Method of Worksheet Class Failed

I'm just guessing, put I suspect is may be the way you are copying an d
pasting that is causing the problem. when you do a copy and paste it is
using the clip board to store the data. You may be running out of space. I
would recommend doing the copying witthout using the clip board.

rather than
MyRange.copy
Newrange.paste


try
MyRange.copy destination:=NewRange - doesn't use clipboard.


"Buddhaful" wrote:

I have a pretty lengthy single module in an excel file which runs fine
when the input file consists of approximately 8,000 or less records.
However, if the input file has 9,000 records or so then the macro
fails at a point when it is trying to move the worksheet from the
input file (a .txt file which is read in as pipe-delimitted and then
parsed) to another excel file which takes the input file data and
performs additional parsing....etc. etc.

I have seen lots of discussion regarding 1004 error messages, but not
anything related to erros associated with what I am experiencing which
is definitely tied to the number of rows from the original text file.

Currently, I am just breaking the input file into 2 and running the
process twice. I'm hoping there is a better solution?

Any ideas?

Thanks in advance for your help.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 1004 - Move Method of Worksheet Class Failed

On Apr 30, 10:58 am, Joel wrote:
I'm just guessing, put I suspect is may be the way you are copying an d
pasting that is causing the problem. when you do a copy and paste it is
using the clip board to store the data. You may be running out of space. I
would recommend doing the copying witthout using the clip board.

rather than
MyRange.copy
Newrange.paste

try
MyRange.copy destination:=NewRange - doesn't use clipboard.



"Buddhaful" wrote:
I have a pretty lengthy single module in an excel file which runs fine
when the input file consists of approximately 8,000 or less records.
However, if the input file has 9,000 records or so then the macro
fails at a point when it is trying to move the worksheet from the
input file (a .txt file which is read in as pipe-delimitted and then
parsed) to another excel file which takes the input file data and
performs additional parsing....etc. etc.


I have seen lots of discussion regarding 1004 error messages, but not
anything related to erros associated with what I am experiencing which
is definitely tied to the number of rows from the original text file.


Currently, I am just breaking the input file into 2 and running the
process twice. I'm hoping there is a better solution?


Any ideas?


Thanks in advance for your help.- Hide quoted text -


- Show quoted text -


I'm doing a move worksheet (fyi - copy/paste will not work as some
columns have a lot of info & the copy results in an error):

Windows("Input.txt").Activate
Sheets("origdata").Select
Sheets("origdata").Move Befo=Workbooks("FinalData.xls"). _
Sheets("Output")

Again, this has to be a memory issue or something else of a similar
nature. This program runs fine when the input data set has less than
8,000 rows. It is only when the input dataset exceeds 8,000 that I
get the error message.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 1004 - Move Method of Worksheet Class Failed

Three things I would do

1) Remove Sheets("origdata").Select. This statement is not needed. My be
the cause of the error. I also think Windows("Input.txt").Activate is not
needed but not sure. this statement I don't thinnk would cause you error,
but you can try to remove it and see what happens.

2) On the excel worksheet - View Menu - Task Pane. when the window open
selct under the down triangle (next to the X) clipboard. When the program
fails see if there are lot of entries in the clipboard. I suspect that
moving between sheets is using the clipboard.

3) If the clipboard is really being used, then generate a new posting with
the code you sent me and see if anybody has a solution. The question is how
not to generate code that will not use the clipboard or a way of clearing the
clipboard.

"Buddhaful" wrote:

On Apr 30, 10:58 am, Joel wrote:
I'm just guessing, put I suspect is may be the way you are copying an d
pasting that is causing the problem. when you do a copy and paste it is
using the clip board to store the data. You may be running out of space. I
would recommend doing the copying witthout using the clip board.

rather than
MyRange.copy
Newrange.paste

try
MyRange.copy destination:=NewRange - doesn't use clipboard.



"Buddhaful" wrote:
I have a pretty lengthy single module in an excel file which runs fine
when the input file consists of approximately 8,000 or less records.
However, if the input file has 9,000 records or so then the macro
fails at a point when it is trying to move the worksheet from the
input file (a .txt file which is read in as pipe-delimitted and then
parsed) to another excel file which takes the input file data and
performs additional parsing....etc. etc.


I have seen lots of discussion regarding 1004 error messages, but not
anything related to erros associated with what I am experiencing which
is definitely tied to the number of rows from the original text file.


Currently, I am just breaking the input file into 2 and running the
process twice. I'm hoping there is a better solution?


Any ideas?


Thanks in advance for your help.- Hide quoted text -


- Show quoted text -


I'm doing a move worksheet (fyi - copy/paste will not work as some
columns have a lot of info & the copy results in an error):

Windows("Input.txt").Activate
Sheets("origdata").Select
Sheets("origdata").Move Befo=Workbooks("FinalData.xls"). _
Sheets("Output")

Again, this has to be a memory issue or something else of a similar
nature. This program runs fine when the input data set has less than
8,000 rows. It is only when the input dataset exceeds 8,000 that I
get the error message.


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 Copy method of worksheet class failed Ayo Excel Discussion (Misc queries) 3 March 28th 08 02:05 PM
Error 1004 Paste method of Worksheet class failed skvabbili Excel Programming 1 May 4th 06 11:03 PM
runtime error 1004 paste method of worksheet class failed wilsoj Excel Programming 12 August 10th 05 08:20 PM
RT Error 1004, Select method of worksheet class failed Dana Sherbondy Excel Programming 2 October 1st 04 03:55 PM
Run Time error 1004 Paste Method of Worksheet Class Failed Ken Nunn Excel Programming 3 June 29th 04 03:23 PM


All times are GMT +1. The time now is 09:28 AM.

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"