Gustav Brock
Gustav at cactus.dk
Sat Nov 14 05:46:42 CST 2009
Hi Stuart I think I read somewhere that .Sheets is considered "legacy" or should be reserved for graphs, and for worksheets it should read: .HPageBreaks.Add Before:=ExcelwBook.WorkSheets(sSheet).Cells(lRow + 1, 6). /gustav >>> stuart at lexacorp.com.pg 14-11-2009 00:22 >>> .HPageBreaks.Add Before:=Cells(lRow + 1, 6) There's your unqualified reference. Change it to: .HPageBreaks.Add Before:=ExcelwBook.sheets(sSheet).Cells(lRow + 1, 6). -- Stuart