lcOldOnError=on('error') on error oExcel=.NULL. oExcel=GetObject(,'Excel.Application') on error &lcOldOnError if isnull(oExcel) && GetObject did not detect an open excel object ** so you could open a "blank" excel session here oExcel=createobject('Word.Application') else * oExcel is NOT null, therefore Excel is alread running on the DT if type('oExcel.ActiveSheet.name')="C" * Now you have the active sheet file name lcExcelFileName=oExcel.ActiveSheet.name * You can also loop through the activesheet collection * when more than one may be open, and you want to * be sure you don't re-open. * PS - you can test this and Cetins advice from the command window. else * Excel is open but no active sheet endif endif