Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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
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
subscript out of range error: tring to copy a hidden sheet sam Excel Programming 1 August 7th 09 11:48 PM
Subscript out of range error - save copy error bg18461[_16_] Excel Programming 2 June 13th 06 04:53 PM
Subscript out of range error - save copy error bg18461[_15_] Excel Programming 1 June 13th 06 04:36 PM
In multiple sheet copy error subscript out of range ?? HELP Eddy Stan Excel Programming 4 March 22nd 06 04:54 AM
Workbook comparison results in subscript out of range error whatisexcel Excel Programming 2 August 20th 04 03:23 AM


All times are GMT +1. The time now is 02:00 PM.

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

About Us

"It's about Microsoft Excel"