Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I have made a macro that copies worksheets from diffrent workbooks, and then places the worksheets into the same workbook. This is a pretty simpel function, but when I have copied to many sheets I recive an error 1004. Is there an easi way to come around this ? This is in a loop: sourceWb.Worksheets("Prodject-" & year).Copy after:=thisWb.Sheets(thisWb.Worksheets.count) -- Newbie80 ------------------------------------------------------------------------ Newbie80's Profile: http://www.excelforum.com/member.php...o&userid=25946 View this thread: http://www.excelforum.com/showthread...hreadid=394664 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi,
Not sure what the problem is that cause it. it has something to do with the clipboard. from experience, i have learned not to use the copy command in a loop. usually crashes the macro with memory error messages. using it once or twice in a macro is ok but not in any kind of loop. there are other ways. and this is not unique to xl. i had the same problem with lotus 123. and the cut command is even worst. try this just before the copy command........ application.cutcopymode = false this will clear your clipboard just before the copy and may solve your problem. post back if it doesn't. regards FSt1 "Newbie80" wrote: Hi, I have made a macro that copies worksheets from diffrent workbooks, and then places the worksheets into the same workbook. This is a pretty simpel function, but when I have copied to many sheets I recive an error 1004. Is there an easi way to come around this ? This is in a loop: sourceWb.Worksheets("Prodject-" & year).Copy after:=thisWb.Sheets(thisWb.Worksheets.count) -- Newbie80 ------------------------------------------------------------------------ Newbie80's Profile: http://www.excelforum.com/member.php...o&userid=25946 View this thread: http://www.excelforum.com/showthread...hreadid=394664 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Still fails ![]() -- Newbie80 ------------------------------------------------------------------------ Newbie80's Profile: http://www.excelforum.com/member.php...o&userid=25946 View this thread: http://www.excelforum.com/showthread...hreadid=394664 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Newbie80,
See MSKB # 210684: 'Copying worksheet programmatically causes run-time error 1004 in Excel' http://tinyurl.com/9283s --- Regards, Norman "Newbie80" wrote in message ... Still fails ![]() -- Newbie80 ------------------------------------------------------------------------ Newbie80's Profile: http://www.excelforum.com/member.php...o&userid=25946 View this thread: http://www.excelforum.com/showthread...hreadid=394664 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() This is the problem, seems like I need to close and reopen th workbook. Seems to be a built in problem/bug in the Copy-method : -- Newbie8 ----------------------------------------------------------------------- Newbie80's Profile: http://www.excelforum.com/member.php...fo&userid=2594 View this thread: http://www.excelforum.com/showthread.php?threadid=39466 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copying worksheet, path/file access error: '\vbxxx.tmp' | Excel Discussion (Misc queries) | |||
Error when copying worksheet | Excel Discussion (Misc queries) | |||
Excel 2003 converted to 2007 copying worksheet error | Excel Discussion (Misc queries) | |||
Error Copying Worksheet | Excel Worksheet Functions | |||
Copying data to another worksheet gives "Type Mismatch" error | Excel Programming |