Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel 2003 - VB Code - Run time error....pls help :(

Greetings,

Heres a challenge, i cant find a solution to this anywhere.

In EXCEL.

Ive got VB code to copy a Template of a Chart, and then populate it with data.
It needs to create about 40-45 graphs... i do this every monday so its
automated for that reason.

anyway, if it creates over around 39 graphs, i get this error:
-----
Run-time error '1004'
copy method of Chart class failed.
-----

This is the line of code is stops on.

Sheets("TEMPLATE").Select
Sheets("TEMPLATE").Copy after:=Sheets(Sheets.Count)

Sheets("TEMPLATE (2)").Select
Sheets("TEMPLATE (2)").Name = KPR_Sheet

-------

Any help would be great.

if i save and close the spreadsheet, it seems to reset the error. ie if i
restart it after i have opened it, i can get another 40 odd sheets before it
fails.




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel 2003 - VB Code - Run time error....pls help :(

Sounds like the old font scaling problem in xl97. If you aren't using xl97,
then make sure the zoom is set at 100%.

You might explore using a pivot table and creating only one chart. If you
are creating static charts and your users are incapable of mastering
pivottables and pivot graphs, then work with one chart, configure it, then
copy as a picutre and paste it to your location. reconfigure, copy as
picutre and paste, Continue on with the other graphs.

--
regards,
Tom Ogilvy

"KnightSurfer" wrote in message
...
Greetings,

Heres a challenge, i cant find a solution to this anywhere.

In EXCEL.

Ive got VB code to copy a Template of a Chart, and then populate it with

data.
It needs to create about 40-45 graphs... i do this every monday so its
automated for that reason.

anyway, if it creates over around 39 graphs, i get this error:
-----
Run-time error '1004'
copy method of Chart class failed.
-----

This is the line of code is stops on.

Sheets("TEMPLATE").Select
Sheets("TEMPLATE").Copy after:=Sheets(Sheets.Count)

Sheets("TEMPLATE (2)").Select
Sheets("TEMPLATE (2)").Name = KPR_Sheet

-------

Any help would be great.

if i save and close the spreadsheet, it seems to reset the error. ie if i
restart it after i have opened it, i can get another 40 odd sheets before

it
fails.






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel 2003 - VB Code - Run time error....pls help :(

Tom,

Many thanks for the quick reply.

1) The template graph that is being used to copy from is set to 100%
2) i cant issue the graphs as a pivot table, as when the report is run, i
then print off all the graphs to a printer for a 30-40 page report.
3) If i created a graph to a location (in the spreadsheet, by creating
another tab/worksheet.) then copy it as a picture to a new page. wouldnt that
be the same as creating over 39 worksheets ?. even if i delete each tab
after its created, and add more, it still fails after about 39 new tabs.

I told you it was a challenging one....

Many Thanks though for taking the time to rely,
Arty.


"Tom Ogilvy" wrote:

Sounds like the old font scaling problem in xl97. If you aren't using xl97,
then make sure the zoom is set at 100%.

You might explore using a pivot table and creating only one chart. If you
are creating static charts and your users are incapable of mastering
pivottables and pivot graphs, then work with one chart, configure it, then
copy as a picutre and paste it to your location. reconfigure, copy as
picutre and paste, Continue on with the other graphs.

--
regards,
Tom Ogilvy

"KnightSurfer" wrote in message
...
Greetings,

Heres a challenge, i cant find a solution to this anywhere.

In EXCEL.

Ive got VB code to copy a Template of a Chart, and then populate it with

data.
It needs to create about 40-45 graphs... i do this every monday so its
automated for that reason.

anyway, if it creates over around 39 graphs, i get this error:
-----
Run-time error '1004'
copy method of Chart class failed.
-----

This is the line of code is stops on.

Sheets("TEMPLATE").Select
Sheets("TEMPLATE").Copy after:=Sheets(Sheets.Count)

Sheets("TEMPLATE (2)").Select
Sheets("TEMPLATE (2)").Name = KPR_Sheet

-------

Any help would be great.

if i save and close the spreadsheet, it seems to reset the error. ie if i
restart it after i have opened it, i can get another 40 odd sheets before

it
fails.







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel 2003 - VB Code - Run time error....pls help :(

wouldn't it be the same a creating 39 worksheets - sure, but you aren't
having a problem creating 39 worksheets.

--
Regards,
Tom Ogilvy


"KnightSurfer" wrote in message
...
Tom,

Many thanks for the quick reply.

1) The template graph that is being used to copy from is set to 100%
2) i cant issue the graphs as a pivot table, as when the report is run, i
then print off all the graphs to a printer for a 30-40 page report.
3) If i created a graph to a location (in the spreadsheet, by creating
another tab/worksheet.) then copy it as a picture to a new page. wouldnt

that
be the same as creating over 39 worksheets ?. even if i delete each tab
after its created, and add more, it still fails after about 39 new tabs.

I told you it was a challenging one....

Many Thanks though for taking the time to rely,
Arty.


"Tom Ogilvy" wrote:

Sounds like the old font scaling problem in xl97. If you aren't using

xl97,
then make sure the zoom is set at 100%.

You might explore using a pivot table and creating only one chart. If

you
are creating static charts and your users are incapable of mastering
pivottables and pivot graphs, then work with one chart, configure it,

then
copy as a picutre and paste it to your location. reconfigure, copy as
picutre and paste, Continue on with the other graphs.

--
regards,
Tom Ogilvy

"KnightSurfer" wrote in message
...
Greetings,

Heres a challenge, i cant find a solution to this anywhere.

In EXCEL.

Ive got VB code to copy a Template of a Chart, and then populate it

with
data.
It needs to create about 40-45 graphs... i do this every monday so its
automated for that reason.

anyway, if it creates over around 39 graphs, i get this error:
-----
Run-time error '1004'
copy method of Chart class failed.
-----

This is the line of code is stops on.

Sheets("TEMPLATE").Select
Sheets("TEMPLATE").Copy after:=Sheets(Sheets.Count)

Sheets("TEMPLATE (2)").Select
Sheets("TEMPLATE (2)").Name = KPR_Sheet

-------

Any help would be great.

if i save and close the spreadsheet, it seems to reset the error. ie

if i
restart it after i have opened it, i can get another 40 odd sheets

before
it
fails.









  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel 2003 - VB Code - Run time error....pls help :(

Ok, i will give it a go, hopefully today.

Many Many Thanks again.
Arty

"Tom Ogilvy" wrote:

wouldn't it be the same a creating 39 worksheets - sure, but you aren't
having a problem creating 39 worksheets.

--
Regards,
Tom Ogilvy


"KnightSurfer" wrote in message
...
Tom,

Many thanks for the quick reply.

1) The template graph that is being used to copy from is set to 100%
2) i cant issue the graphs as a pivot table, as when the report is run, i
then print off all the graphs to a printer for a 30-40 page report.
3) If i created a graph to a location (in the spreadsheet, by creating
another tab/worksheet.) then copy it as a picture to a new page. wouldnt

that
be the same as creating over 39 worksheets ?. even if i delete each tab
after its created, and add more, it still fails after about 39 new tabs.

I told you it was a challenging one....

Many Thanks though for taking the time to rely,
Arty.


"Tom Ogilvy" wrote:

Sounds like the old font scaling problem in xl97. If you aren't using

xl97,
then make sure the zoom is set at 100%.

You might explore using a pivot table and creating only one chart. If

you
are creating static charts and your users are incapable of mastering
pivottables and pivot graphs, then work with one chart, configure it,

then
copy as a picutre and paste it to your location. reconfigure, copy as
picutre and paste, Continue on with the other graphs.

--
regards,
Tom Ogilvy

"KnightSurfer" wrote in message
...
Greetings,

Heres a challenge, i cant find a solution to this anywhere.

In EXCEL.

Ive got VB code to copy a Template of a Chart, and then populate it

with
data.
It needs to create about 40-45 graphs... i do this every monday so its
automated for that reason.

anyway, if it creates over around 39 graphs, i get this error:
-----
Run-time error '1004'
copy method of Chart class failed.
-----

This is the line of code is stops on.

Sheets("TEMPLATE").Select
Sheets("TEMPLATE").Copy after:=Sheets(Sheets.Count)

Sheets("TEMPLATE (2)").Select
Sheets("TEMPLATE (2)").Name = KPR_Sheet

-------

Any help would be great.

if i save and close the spreadsheet, it seems to reset the error. ie

if i
restart it after i have opened it, i can get another 40 odd sheets

before
it
fails.












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
Excel 2003 WorksheetFunction Functions run-time error Dave Setting up and Configuration of Excel 2 September 24th 07 04:54 PM
Run time error 1004 When running in 2003 Lakshman Excel Discussion (Misc queries) 10 January 17th 07 06:06 PM
Run-time error from my code Matt Excel Programming 5 June 24th 04 03:32 AM
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) Tim[_36_] Excel Programming 4 April 23rd 04 02:53 AM
Code Run-time error '1004' pjhageman[_5_] Excel Programming 3 January 11th 04 12:24 AM


All times are GMT +1. The time now is 03:17 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"