I have a very complex worksheet which currently writes lines and text boxes (by VBA) overtop / underneath a transparent graph.
When updating these lines / text boxes, I must start by removing all previous.
All was working fine until excel 2010 was installed. (previously 2003)
Here is the sample of the previous deletion code.
It is important that only lines and text boxes be deleted. (the graph must remain intact)
Thanks to all
Private Sub SheetObjDel()
Dim intObj As Long
Dim i As Long
Dim tmp As String
Dim exist_cnt As Long
exist_cnt = 0
intObj = ActiveSheet.Shapes.Count
Range("A1").Activate
For i = 1 To intObj
obName = ActiveSheet.Shapes(i).Name
If ActiveSheet.Shapes(i).Top > ActiveSheet.Range("I8").Top Then
ActiveSheet.Shapes(i).Select False
exist_cnt = exist_cnt + 1
End If
Next i
If exist_cnt > 0 Then
Selection.Delete
End If
End Sub
When updating these lines / text boxes, I must start by removing all previous.
All was working fine until excel 2010 was installed. (previously 2003)
Here is the sample of the previous deletion code.
It is important that only lines and text boxes be deleted. (the graph must remain intact)
Thanks to all
Private Sub SheetObjDel()
Dim intObj As Long
Dim i As Long
Dim tmp As String
Dim exist_cnt As Long
exist_cnt = 0
intObj = ActiveSheet.Shapes.Count
Range("A1").Activate
For i = 1 To intObj
obName = ActiveSheet.Shapes(i).Name
If ActiveSheet.Shapes(i).Top > ActiveSheet.Range("I8").Top Then
ActiveSheet.Shapes(i).Select False
exist_cnt = exist_cnt + 1
End If
Next i
If exist_cnt > 0 Then
Selection.Delete
End If
End Sub