* Get Excel application object: m.loExcel = CREATEOBJECT( "Excel.Application" ) * Data munging to create a VFP cursor happens here * Save the cursor to a FOX2X file that can be opened by Excel: m.lcDBF2X = ADDBS( SYS( 2023 ) ) + SYS( 2015 ) + ".DBF" COPY ALL TO ( m.lcDBF2X ) TYPE FOX2X * The following DOEVENTS call "fixed" OLE errors long ago with Win7/Excel 2007: DOEVENTS FORCE * Open the FOX2X DBF in Excel, save to .XLSX format: m.loExcel.DisplayAlerts = .F. * The next line is the one that throws errors: m.loWorkbook = m.loExcel.Application.Workbooks.Open( m.lcDBF2X )