LOCAL lcTable, loExcel, lcExcel lcExcel = SYS(5) + ADDBS(SYS(2003)) + "Northwind Customers.xlsx" lcTable = ADDBS(SYS(2004)) + "Samples\Northwind\customers.dbf" lcTable = LOCFILE(lcTable) IF !ISNULL(lcTable) AND FILE(lcTable) loExcel = NEWOBJECT("VFPxWorkbookXLSX", "VFPxWorkbookXLSX.vcx") loExcel.SaveTabletoWorkbook(lcTable, lcExcel, .T., .T.) ENDIFBut in my case (in my program), user already has a cursor open and needs to export it to Excel. Your code (above) seems to rely on the .DBF being opened by the method .SaveTableToWorkBook(). Do you know how (and where) I can modify your code to use whatever cursor is open and convert it to the specified excel file name, instead of trying to open it?