If both of Al's tips don't help, you might try to automate that mesage away as well - but that is a cludge and Al's way is much better. Vfp's Keyboard() will probably not work, but there are WINAPI functions available and the Scripting Host has methods often working when Keyboard() fails.
>I don't know why this should be an issue but I am running into a loop because the sheets are not being deleted with this command.
>What may explain this is as follows: I have run across a message (upon opening excel) which states ' data may exist in the sheets selected for deletion. To permanently delete the data press delete' - and this requires selection of 'delete' in excel. This message then pops on each of the sheets marked for deletion. this could be the reason my sheets are not deleting inside the loop.
>
>Is there a way around this?
>
>
>owb.Sheets(mname).Delete
>
>
>k