"file available for read/write" message

G

Guest

My thanks to anyone who reads and replies to this

I have written a macro which does a number of things:

1) Writes a number of script files for a third party software product
2) Writes a .bat file to execute the scripts
3) Loops until the resulting output files are found
4) Imports the files (text files
5) Copies the required data into my spreadsheet
6) Closes the txt files (SaveChanges = False

The problem I have is that when the macro completes, a few seconds later, an Excel popup proclaims "The file "####.txt" is available for read/write" for each of the txt files previously imported and closed

Why? and, how can I prevent this happening

Thanks again.
 
N

Nigel

MikeP,
Is it an Excel popup or your 3rd party speaking?

Think you going to have to send the code along for further assistance on
this one.

Cheers
Nigel

MikeP said:
My thanks to anyone who reads and replies to this.

I have written a macro which does a number of things:-

1) Writes a number of script files for a third party software product.
2) Writes a .bat file to execute the scripts.
3) Loops until the resulting output files are found.
4) Imports the files (text files)
5) Copies the required data into my spreadsheet.
6) Closes the txt files (SaveChanges = False)

The problem I have is that when the macro completes, a few seconds later,
an Excel popup proclaims "The file "####.txt" is available for read/write"
for each of the txt files previously imported and closed.
 
G

Guest

Nigel

It's an Excel pop-up for "file reservation". I can't type all the code in as it's a work based script but in the most succinct nutshell I can muster, the script goes something like:

Check dir for scripts/txts/bats and kill
Print worksheets 1-7 as script file
Print command line to execute scripts as bat fil
ReturnVal shell = .bat fil
Do loop until resulting txt files are found - exit if counter > 500
Workbooks.OpenText resulting text file
Copy required cells to output page of main workboo
Close text file
Save workbook

I hope that's enough info and thanks for the reply
Save active workboo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top