select path1; from cheqs; where bank= (thisform.pageframe1.page5.text6.value); and branch= alltrim(thisform.pageframe1.page5.text3.value); into cursor acc2 for x=1 to oexcel.activeworkbook.sheets.count select acc2 scan pa=path1 oexcel.Sheets(x).Name = juststem(pa) endscan endforThe above procedure shows following error message