>Function ExportToExcel >Lparameters tcCursorName >tcCursorName = Iif(Empty(m.tcCursorName),Alias(),m.tcCursorName) >Local loConn As AdoDB.Connection, loRS As AdoDB.Recordset,; > lcTempRs, lcTemp, oExcel >lcTemp = ForcePath(Sys(2015)+'.dbf',Sys(2023)) >lcTempRs = ForcePath(Sys(2015)+'.rst',Sys(2023)) >Select (m.tcCursorName) >Copy To (m.lcTemp) >loConn = Createobject("Adodb.connection") >loConn.ConnectionString = "Provider=VFPOLEDB;Data Source="+Addbs(Sys(2023)) >loConn.Open() >loRS = loConn.Execute("select * from "+JustStem(m.lcTemp)) >loRS.Save(m.lcTempRs) && Followed by loRS is not an object - should be here. >loRS.Close >loConn.Close >Erase (m.lcTemp) >loRS.Open(m.lcTempRs) > >oExcel = Createobject("Excel.Application") >With oExcel > .WorkBooks.Add > With .ActiveWorkBook.ActiveSheet > .Name = "My Export" > .QueryTables.Add( loRS, .Range("A1")).Refresh() > .Range("A1").AutoFormat(8) && xlRangeAutoFormatColor2 > .Range("A1").Activate > Endwith > .Visible = .T. >Endwith >loRs.Close >Erase (m.lcTempRS) >Can anyone try this code and hopefully reproduce the error. Customers have VFPOLEDB version 7.x but updating one of them to 9.x didn't help.