View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Uwe Uwe is offline
external usenet poster
 
Posts: 9
Default error 70 permission denied in excel

I have a bit of code that tries to cleat some entries from a sheet if they
are more than 10 days old. Some rows have comments and a small image that
does not delete when you delete a row. I am trying to select it and delete
it. When the select is executed I get the error message.
For r = xlSheet.Cells(xlSheet.Rows.Count, 1).End(xlUp).Row To 2 Step -1
If DateDiff("d", xlSheet.Cells(r, 1), Now()) 10 Then
xlSheet.Range("G" & Trim(Str(r))).Select
If Not xlSheet.Range("G" & Trim(Str(r))).Comment Is Nothing
Then
xlSheet.Shapes.Range(xlSheet.Shapes.Count).Select
xlSheet.Shapes.Range(xlSheet.Shapes.Count).Delete
End If
xlSheet.Rows(r).EntireRow.Delete
End If
Next r
--
Thanks,
Uwe