Auke,
I don't believe the problem is with your code, but I'm not sure what else to suggest. Are you running Excel locally? I am also on Excel2000, and I ran the following code in 2-3 seconds:
local oExcel, wkbk, xlsheet
oExcel = createObject("Excel.Application")
oExcel.visible = .t.
oExcel.displayAlerts = .f.
wkbk = oExcel.workbooks.add()
xlSheet = wkbk.activesheet
with xlSheet.pageSetup
.CenterHeader = "Center Header Test"
.LeftHeader = "Left Header Test"
.RightHeader = "Right Header Test"
.LeftFooter = "Left Footer Test"
.CenterFooter = "Center Footer Test"
.RightFooter = "Right Footer Test"
.topMargin = oExcel.inchesToPoints(0)
.headerMargin = oExcel.inchesToPoints(0)
.footerMargin = oExcel.inchesToPoints(0)
.bottomMargin = oExcel.inchesToPoints(0)
.leftMargin = oExcel.inchesToPoints(0)
.rightMargin = oExcel.inchesToPoints(0)
.orientation = 2
endwith
oExcel.quit()
xlSheet = .NULL.
wkbk = .NULL.
oExcel = .NULL.
release xlSheet
release wkbk
release oExcel
Paul A. Busbey
Victoria Insurance