Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-08-2019, 07:53 AM
gmaxey gmaxey is offline KILL errors RTE 70 Windows 10 KILL errors RTE 70 Office 2016
Expert
KILL errors RTE 70
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,600
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default KILL errors RTE 70

I have an add-in for processing batch files in a selected folder. One of the built-in batch processes converts older .doc and .dot format files as .docx, .docm, .dotx or .dotm as appropriate.




It basically just opens the file and saves it in a new format then deletes the old .doc or .dot file.

It works fine with Word 2010-2019. And it "almost" works with Word 2007. However, it won't delete the old file. It errors on the Kill statement below with RTE 70. Permission Denied (other attempts e.g., FileSystemObject also result in RTE 70).


Code:
Case "Convert older format documents"
        strTempName = oDoc.FullName
        If Right(LCase(oDoc.Name), 3) = "dot" Then
          mod_Convert.ConvertFiles oDoc, oDoc.Path, True
        Else
          mod_Convert.ConvertFiles oDoc, oDoc.Path, False
        End If
        If .optActiveDocument Then
          If .chkMatchWildCards.Value = True Then
            strNewName = oDoc.FullName
            oDoc.Close 0
            DoEvents
            Kill strTempName
            Documents.Open strNewName
          End If
        Else
          oDoc.Close 0
          DoEvents
          If .chkMatchWildCards.Value = True Then Kill strTempName
        End If

The file is not open but Windows seems to think it is. If I close Word and then reopen Word, I can then delete the file with a simple Kill statement.

I have tried:


SetAttr strTempName, vbNormal

Does anyone know how to force Windows to "rethink" the state of a file that is not opened and allow the Kill to proceed without error?


Thanks.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
KILL errors RTE 70 Kill the file based on date Villalobos Word VBA 9 07-06-2017 09:50 PM
Odd errors cyberslugg PowerPoint 2 02-23-2016 01:26 PM
KILL errors RTE 70 Need Help With KILL Command PosseJohn Word VBA 1 12-09-2013 03:32 PM
"One or more margins are set outside the printable area of the page." How to kill? WaltR Word 4 07-16-2012 01:55 PM
KILL errors RTE 70 Help! What Are These & How Do I Kill Them? Finn O'Deirg Word 2 07-03-2012 01:54 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:45 AM.


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