Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Stop excel changing chart axes labels when letters are repeated | Charts and Charting in Excel | |||
Repeated web queries eventual return error 1004 | Excel Discussion (Misc queries) | |||
Error message when copying Excel Pie Chart to Word (in Office 2007 | Charts and Charting in Excel | |||
Copying the repeated data of the previous sheet to the next sheet | Excel Discussion (Misc queries) | |||
Printing text in a repeated cell/row that is longer than repeated | Excel Discussion (Misc queries) |