Hi there!

I have a small problem and I hope someone here has an answer for me. I'm working on a program that displays some info on a MSgrid on a form. I need to print the form so I figured I could copy each cell to a cel in an Excel file; but so far I haven´t been able to do it, what I need is some code like the following:

Dim iCol as integer, iRow as integer
Dim xlsReport as Excel.Worksheet, xlsFile as xcel.Workbook

Set xlsFile = Excel.OpenWorkbook(sReportFileName)
Set xlsReport = xlsFile.Worksheets(1)

With grdCalendar
For iCol = 0 to .Cols - 1
For iRow = 0 to .Rows - 1
.Col = iCol
.Row = iRow
xlsReport.Cells(iRow, iCol).Text = .Text
xlsReport.Cells(iRow, iCol).BackColor = vbRed
Next iRow
Next iCol
End With

xlsReport.Application.Visible = True
xlsReport.Applicarion.PrintPreview



Could someone tell me how to do this? Thanks for your time and attention.
Please send any answers or sugestions to [email protected]