Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Error from repeated chart copying

I have an application which repeatedly copies a chart to a new tab in a
workbook, then deletes the new copy after the user has finished. This works
fine for a while but eventually an error results when the copy is attempted.
No further charts can be created until the workbook is closed and re-opened.

The number of successful copies seems to depend on the complexity of the
workbook. For a complex workbook, 42 charts could be made before an error
occurred. For a simpler workbook, 254 was the number. The error is
reproducible:

Make a new workbook and put a chart in it. Run the following code:

Public Sub ChartCopyErrorTest()
Application.DisplayAlerts = False
Do
On Error GoTo printerr
ActiveWorkbook.Sheets("Chart1").Copy
Befo=ActiveWorkbook.Sheets("Sheet1")
On Error GoTo 0
a$ = "This is chart number " & Format(i%)
ActiveChart.Name = a$
ActiveChart.Delete
DoEvents
i% = i% + 1
Loop While i% < 1000

printerr:
MsgBox "Bombed after making this many charts: " & Format(i%)
End Sub

On my machine, the number displayed is 254. Version of Excel is 2002
(10.6789.6811) SP3.

Has anyone else seen this problem, and more importantly, know of a workaround?
--
Pat Wiegand
Ridgewood Visionware
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Error from repeated chart copying

Check out this link...

http://support.microsoft.com/default...84&Product=xlw
--
HTH...

Jim Thomlinson


"Pat Wiegand" wrote:

I have an application which repeatedly copies a chart to a new tab in a
workbook, then deletes the new copy after the user has finished. This works
fine for a while but eventually an error results when the copy is attempted.
No further charts can be created until the workbook is closed and re-opened.

The number of successful copies seems to depend on the complexity of the
workbook. For a complex workbook, 42 charts could be made before an error
occurred. For a simpler workbook, 254 was the number. The error is
reproducible:

Make a new workbook and put a chart in it. Run the following code:

Public Sub ChartCopyErrorTest()
Application.DisplayAlerts = False
Do
On Error GoTo printerr
ActiveWorkbook.Sheets("Chart1").Copy
Befo=ActiveWorkbook.Sheets("Sheet1")
On Error GoTo 0
a$ = "This is chart number " & Format(i%)
ActiveChart.Name = a$
ActiveChart.Delete
DoEvents
i% = i% + 1
Loop While i% < 1000

printerr:
MsgBox "Bombed after making this many charts: " & Format(i%)
End Sub

On my machine, the number displayed is 254. Version of Excel is 2002
(10.6789.6811) SP3.

Has anyone else seen this problem, and more importantly, know of a workaround?
--
Pat Wiegand
Ridgewood Visionware

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Error from repeated chart copying

Thanks, Jim -- exactly the link I needed. You're awsome!
--
Pat Wiegand
Ridgewood Visionware


"Jim Thomlinson" wrote:

Check out this link...

http://support.microsoft.com/default...84&Product=xlw
--
HTH...

Jim Thomlinson


"Pat Wiegand" wrote:

I have an application which repeatedly copies a chart to a new tab in a
workbook, then deletes the new copy after the user has finished. This works
fine for a while but eventually an error results when the copy is attempted.
No further charts can be created until the workbook is closed and re-opened.

The number of successful copies seems to depend on the complexity of the
workbook. For a complex workbook, 42 charts could be made before an error
occurred. For a simpler workbook, 254 was the number. The error is
reproducible:

Make a new workbook and put a chart in it. Run the following code:

Public Sub ChartCopyErrorTest()
Application.DisplayAlerts = False
Do
On Error GoTo printerr
ActiveWorkbook.Sheets("Chart1").Copy
Befo=ActiveWorkbook.Sheets("Sheet1")
On Error GoTo 0
a$ = "This is chart number " & Format(i%)
ActiveChart.Name = a$
ActiveChart.Delete
DoEvents
i% = i% + 1
Loop While i% < 1000

printerr:
MsgBox "Bombed after making this many charts: " & Format(i%)
End Sub

On my machine, the number displayed is 254. Version of Excel is 2002
(10.6789.6811) SP3.

Has anyone else seen this problem, and more importantly, know of a workaround?
--
Pat Wiegand
Ridgewood Visionware

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
Stop excel changing chart axes labels when letters are repeated Leslie Haas Charts and Charting in Excel 2 April 13th 09 05:37 PM
Repeated web queries eventual return error 1004 PeterQ Excel Discussion (Misc queries) 0 March 1st 08 09:55 PM
Error message when copying Excel Pie Chart to Word (in Office 2007 Market1 Charts and Charting in Excel 0 December 12th 07 05:01 PM
Copying the repeated data of the previous sheet to the next sheet Sasikiran Excel Discussion (Misc queries) 1 September 25th 07 03:18 PM
Printing text in a repeated cell/row that is longer than repeated Valerie Dyet Excel Discussion (Misc queries) 1 February 13th 06 03:27 AM


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