#define xlLastCell 11 #define xlMaximized -4137 #define xlRangeAutoformatClassic2 2 #define xlPortrait 1 LOCAL lcFileName * Get file name to open lcFileName = GETFILE() * make sure the reference is null first oExcel = .null. * then open excel and make the data look good, like this oExcel = CreateObject("Excel.Application") if vartype(oExcel) != "O" * could not instantiate Excel object * show an error message here return .F. endif * open the workbook you just created oWorkbook = oExcel.Application.Workbooks.Open(lcFileName) * turn off alerts oExcel.DisplayAlerts = .F. * dont need it visible just need info from it oExcel.visible = .f. *!* * rename the Sheet to whatever you like *!* oActiveSheet = oExcel.ActiveSheet *!* oActiveSheet.Name = "MyData" *!* oExcelApp = oExcel.Application *!* oExcelApp.WindowState = xlMaximized * display values for testing purposes ? oExcel.Range("b2").Value ? oExcel.Range("b3").Value ? oExcel.Range("b4").Value ? oExcel.Range("b5").Value ? oExcel.Range("b6").Value ? oExcel.Range("b7").Value ? oExcel.Range("b8").Value ? oExcel.Range("b9").Value ? oExcel.Range("b10").Value ? oExcel.Range("b11").Value * done, remove reference oExcel = .null. RETURN