loCol.Value = evaluate( laFields[i,1] )i try to change loWorkbook to loWorkbookS for all code,same thing
CLOSE all USE AM2 IN 0 Select * from am2 ; where INLIST( val(char3), 100, 201, 202, 203 ); and ( inList( upper(allt(telno)), "ADSL 1")) ; into table am3 nofilter USE am3 INDEX ON telno TO kk ascending brow loExcel = createobject( "excel.application" ) loExcel.Visible = .t. loWorkbooks = loExcel.Workbooks loWorkbooks.Add() loWorkbooks = loExcel.ActiveWorkbook loSheet = loExcel.ActiveSheet ******************************************* ? loWorkbooks.Sheets.Count && examine how many sheets the workbook contains loSheet = loWorkbooks.Sheets(2) && pick the second sheet loWorkbooks.Sheets.Add() && add a new sheet to the Sheets collection *********************************************** n = afields( laFields ) ? n scan loRow = loSheet.Rows( recno() ) for i = 1 to n loCol = loRow.Cells(,i) loCol.Value = evaluate( laFields[i,1] ) endfor endscan loCol = .null. loRow = .null.thank you,
? loWorkbook.Sheets.Count && examine how many sheets the workbook contains > >loSheet = loWorkbook.Sheets(2) && pick the second sheet > >loWorkbook.Sheets.Add() && add a new sheet to the Sheets collection >>