>for lnI = 1 to m.lnCols > .Cells(1,laFieldNames[m.lnI,3]).value = laFieldNames[m.lnI,1] > try > if .range(chr(64 + m.lnI) + ":" + chr(64 + m.lnI)).columns.columnwidth < 50 > .range(chr(64 + m.lnI) + ":" + chr(64 + m.lnI)).columns.columnwidth = ; > .range(chr(64 + m.lnI) + ":" + chr(64 + m.lnI)).columns.columnwidth * 5 && To make sure long descriptions fit > endif > catch to loRangeProblem >* Let's ignore this error with the range and column width > endtry > next>
LOCAL oExcel AS Excel.Application oExcel = CREATEOBJECT([Excel.Application]) oExcel.Workbooks.Add() oExcel.Columns([B:C]).Select oExcel.Selection.EntireColumn.Hidden = .t. && Hide columns B and C oExcel.Visible = .t. INKEY(0) oExcel.Columns([A:IV]).Select oExcel.Selection.EntireColumn.Hidden = .f. && Unhide all hidden columns INKEY(0) *** Freeze first row of sheet oExcel.Rows("2:2").Select oExcel.ActiveWindow.FreezePanes = .t. INKEY(0)