Bridgetree
New Member
- Joined
- Jun 1, 2005
- Messages
- 19
I have a macro that imports a bunch of flat files into separate worksheets in another workbook then at the end activates the original workbook containing the macro and closes it like this:
Windows("ORIGINALFile.xls").Activate
ActiveWorkbook.Close False
All I did was add a KILL statement before the close to delete all the flat files like this:
KILL "c:\folder1\folder2\filena*"
Windows("ORIGINALFile.xls").Activate
ActiveWorkbook.Close False
and now I get an error on the activate. I don't have a very good VBA reference so I'm not sure I'm doing it with the correct commands? Can anyone help me with why it worked before the KILL statement was added and now doesn't?
Windows("ORIGINALFile.xls").Activate
ActiveWorkbook.Close False
All I did was add a KILL statement before the close to delete all the flat files like this:
KILL "c:\folder1\folder2\filena*"
Windows("ORIGINALFile.xls").Activate
ActiveWorkbook.Close False
and now I get an error on the activate. I don't have a very good VBA reference so I'm not sure I'm doing it with the correct commands? Can anyone help me with why it worked before the KILL statement was added and now doesn't?