Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error in a "Kill" command
Excel XP & Win XP
In this snippet of code I am trying to "Kill" 3 files. I get a "Subscript out of range" error on the "Kill" command with the first file. So I changed the order of the files in the "For Each.." line and again I get that error with the first name. This tells me that the problem is with the "Kill" line. The "ThePathDocs" is the path to the folder that holds the files. What did I do wrong? Thanks for your time. Otto For Each TheFile In Array("One.doc", "Two.doc", "Three.doc") Workbooks(ThePathDocs & TheFile).ChangeFileAccess xlReadOnly Kill Workbooks(ThePathDocs & TheFile).FullName |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ie Command to Wait for "File Download" and "Save As" windows | Excel Programming | |||
XLL and "New Form" command error | Excel Programming | |||
FileCopy Command Giving "Subscript Out of Range" Error Message | Excel Programming | |||
Exel2000 VBA - Creating a Command Bar - Error: "Object Variable or With not Set" | Excel Programming |