Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-04-2018, 01:58 PM
macropod's Avatar
macropod macropod is offline Testing for 'Object has been deleted' error Windows 7 64bit Testing for 'Object has been deleted' error Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,385
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default


Quote:
Originally Posted by Cosmo View Post
That won't help me, since it will always set the table to nothing if the first row is empty. There may be other rows that were not deleted, and the table will need further processing.
In that case, try:
Code:
Dim Tbl As Table, r As Long
For Each Tbl In ActiveDocument.Tables
  With Tbl
    If Len(.Range.Text) = .Range.Cells.Count * 2 + .Rows.Count * 2 Then
      .Delete: Set Tbl = Nothing
    Else
      For r = .Rows.Count To 1 Step -1
        With .Rows(r)
          If Len(.Range.Text) = .Cells.Count * 2 + 2 Then
            .Delete
          End If
        End With
      Next
    End If
  End With
  MsgBox Tbl Is Nothing
Next
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
set row object variable error CLoos Excel Programming 6 03-10-2017 04:48 PM
Testing for 'Object has been deleted' error Run-time error '424': Object required zlodeh Excel Programming 1 02-24-2016 01:58 AM
Testing for 'Object has been deleted' error Run Time Error 424 - Object Required Doug Needham Excel Programming 4 01-12-2015 10:54 PM
Testing for 'Object has been deleted' error Error Message: Could not load an object... simstem Word 1 10-06-2012 08:44 PM
XML parsing & Object variable not set (Error 91) tinfanide Excel Programming 0 12-29-2011 08:43 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:30 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft