Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy sheets to new workbook - subscript error
G'day all you clever people, hope someone can help me
I am using the code: ActiveSheet.Copy after:=Workbook("Example.xls").Sheets(i) to copy a dynamic selection of sheets from one workbook to another The code works just fine until the 18th sheet is copied across, then I get a subscript out of range error message This is really frustrating as I know the code works, but I am limited in how often I can use it, and I want to copy across 50+ sheets. Has anyone come across this issue before and does anyone know a good way to solve it? PS, I ran the same code in Excel2007 and managed 45 repititions before I get the same subscript out of range error Kind regards Tiger |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy sheets to new workbook - subscript error
Assuming your value for i is correct (i.e. not greater than the number of sheets), try saving the target workbook periodically (after every 10 copies for example). the_tiger_grrr;697911 Wrote: G'day all you clever people, hope someone can help me I am using the code: ActiveSheet.Copy after:=Workbook("Example.xls").Sheets(i) to copy a dynamic selection of sheets from one workbook to another The code works just fine until the 18th sheet is copied across, then I get a subscript out of range error message This is really frustrating as I know the code works, but I am limited in how often I can use it, and I want to copy across 50+ sheets. Has anyone come across this issue before and does anyone know a good way to solve it? PS, I ran the same code in Excel2007 and managed 45 repititions before I get the same subscript out of range error Kind regards Tiger -- aflatoon Regards, A. ------------------------------------------------------------------------ aflatoon's Profile: http://www.thecodecage.com/forumz/member.php?u=1501 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=195202 http://www.thecodecage.com/forumz |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy sheets to new workbook - subscript error
See
http://support.microsoft.com/kb/210684/en-us -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "the_tiger_grrr" wrote in message ... G'day all you clever people, hope someone can help me I am using the code: ActiveSheet.Copy after:=Workbook("Example.xls").Sheets(i) to copy a dynamic selection of sheets from one workbook to another The code works just fine until the 18th sheet is copied across, then I get a subscript out of range error message This is really frustrating as I know the code works, but I am limited in how often I can use it, and I want to copy across 50+ sheets. Has anyone come across this issue before and does anyone know a good way to solve it? PS, I ran the same code in Excel2007 and managed 45 repititions before I get the same subscript out of range error Kind regards Tiger |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
subscript out of range error: tring to copy a hidden sheet | Excel Programming | |||
Subscript out of range error - save copy error | Excel Programming | |||
Subscript out of range error - save copy error | Excel Programming | |||
In multiple sheet copy error subscript out of range ?? HELP | Excel Programming | |||
Workbook comparison results in subscript out of range error | Excel Programming |