Lee,
Still do not use the macro substitution but name expression. You can force a wait till workbook you open closes :
declare Sleep in Win32API integer
handle=fopen(lcXLSName,12)
do while handle<0
Sleep(1000)
handle=fopen(lcXLSName,12)
enddo
=fclose(handle)
Cetin
>Thanks for the reply Cetin.
>
>The reason I used macro subst is because the workbooks the information is being appended from may have more than one worksheet. I generally open the workbook up to get the sheet names into an array and append the data from each sheet.
>I've a suspicion that the problem I've been encountering may be caused by the program trying to proceed before the instance of excel has had a chance to close. Therefore it is still open when it tries to append the data from the workbook.
>
>Lee.