Runtime Error 91 Object variable or With block variable not set.
I suspect your problem is this line:
rHeader = pWorksheet.Range(Cells(1, 1), Cells(1, iColCount))
Try this:
Set rHeader = pWorksheet.Range(Cells(1, 1), Cells(1, iColCount))
since rHeader is a Range object.
Hth,
Merjet
|