View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\) Rick Rothstein \(MVP - VB\) is offline
external usenet poster
 
Posts: 2,202
Default Deleting a txt file after reaqing it

You could use VBA's Kill statement to remove the text file; however, you
should understand that the removal is permanent... a copy of the Kill'ed
file will NOT be in your Recycle Bin afterwards. I mention this because if
you read the file in, then Kill it, and your system should crash before you
save the spreadsheet, the data will be lost and the original text file will
not be recoverable. You could consider using the FileCopy statement to copy
the file into a Temp directory, then Kill it from its original location;
that way, you could delete it with your regular Temp directory clean up
sometime later on when you have safely saved the spreadsheet and/or backed
up your system.

Rick


"Jeff W." wrote in message
...
My work book prompts me for a txt file that I read data onto one of
my sheets to, and I want to delete this txt file after the read.

I'm not sure how to do this, can anyone offer advice

Thanks,

Jeff W.