LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Error problems

Hiya I have this section of code which takes up to forty charts, identified
by references and pastes them into a word document.

I have an error handling statement which if the chart doesn't exist should
enable the procedure to recover and go on to the next chart.

I am testing the code by giving a reference to a chart that doesn't exist.
Unfortunately the code still crashes with an 1004 error, which I thought
would be trapped.

I do have another error handling code previously in the code but this should
be switched off when it reaches the code shown below.

Can anyone help? I can give more info if needed. Here is the code:


For ChartIdentifierNum = 1 To 40

ChartIdentifier = Sheets("Report Export Ref").Cells(3 +
ChartIdentifierNum, 5).Value
ChartReference = Sheets("Report Export Ref").Cells(3 +
ChartIdentifierNum, 6).Value

If ChartIdentifier < "" Then

If ChartReference < "" Then

Worksheets("Chart Sheet").Activate

On Error GoTo SkipChart
ActiveSheet.ChartObjects(ChartReference).Select

Selection.Copy

With wdApp
Set MyRange = .ActiveDocument.Content

MyRange.Find.Execute FindText:=ChartIdentifier, Forward:=True

If MyRange.Find.Found = True Then

MyRange.Select

.Selection.PasteSpecial Link:=False,
DataType:=wdPasteMetafilePicture, Placement:=wdInLine, DisplayAsIcon:=False

End If
End With

SkipChart:

On Error GoTo 0

End If

End If

Next ChartIdentifierNum


TIA!

A confused,

Nick Shinkins



 
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
sorting problems - error message: identically sized merged cells. 4markw Excel Discussion (Misc queries) 2 January 5th 10 06:28 PM
Formula problems that keep producing a #Value! Error!! Danny Boy Excel Worksheet Functions 10 June 21st 09 06:11 PM
File Sharing Problems - Error Message Kristi - Skills Group Excel Discussion (Misc queries) 1 December 17th 04 05:50 PM
Textbox error checK problems Jako[_51_] Excel Programming 1 July 31st 04 10:47 PM
Problems ignoring error message Dr. Schwartz[_3_] Excel Programming 1 February 24th 04 03:26 PM


All times are GMT +1. The time now is 05:25 AM.

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"