I should be able to do this but can't seem to get my head around it.
I can bypass the error, but what I'm looking for is a simple OK MessageBox to appear when an error occurs in my code. i.e. when a Screendump has not been copied to the Clipboard yet.
The error occurs on line "Selection.ShapeRange.IncrementTop 1.5" - if there's no 'Shape' to work with?
My code at the moment reads:
Sub InsertClipboard()
Range("C3").Select
ActiveSheet.Paste
On Error GoTo 0
Exit Sub
Selection.ShapeRange.IncrementTop 1.5
Selection.ShapeRange.IncrementLeft 1.5
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = 430.5
Selection.ShapeRange.Width = 794.25
Selection.ShapeRange.Rotation = 0#
Selection.ShapeRange.ScaleWidth 1.9, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 2.46, msoFalse, msoScaleFromTopLeft
Range("A1").Select
End Sub
I'm just looking for a simple message to say "No Image available" across the bar.
With "Copy to Clipboard and try again" in the body.
Any help appreciated.
I can bypass the error, but what I'm looking for is a simple OK MessageBox to appear when an error occurs in my code. i.e. when a Screendump has not been copied to the Clipboard yet.
The error occurs on line "Selection.ShapeRange.IncrementTop 1.5" - if there's no 'Shape' to work with?
My code at the moment reads:
Sub InsertClipboard()
Range("C3").Select
ActiveSheet.Paste
On Error GoTo 0
Exit Sub
Selection.ShapeRange.IncrementTop 1.5
Selection.ShapeRange.IncrementLeft 1.5
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = 430.5
Selection.ShapeRange.Width = 794.25
Selection.ShapeRange.Rotation = 0#
Selection.ShapeRange.ScaleWidth 1.9, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 2.46, msoFalse, msoScaleFromTopLeft
Range("A1").Select
End Sub
I'm just looking for a simple message to say "No Image available" across the bar.
With "Copy to Clipboard and try again" in the body.
Any help appreciated.