>I am trying to automate some excel printing within my VFP application. I am able to print ok, but I need the spreadsheet to be landscape and to always print rows 1 and 2 on each page.
>
>I have included the necessary .h files (office97.h and xl97cons.h). Within the xl97cons.h, it denotes xlLandscape as a constant. Once my code gets to the following lines, I get a runtime error (invalid number of parameters):
>
>ObjExcel.ActiveSheet.Pagesetup.Orientation(xlLandscape)
>ObjExcel.ActiveSheet.Pagesetup.PrintTitleRows("1:2")
>
>
>The error occurs when trying to make landscape. I am not sure if the PrintTitleRows syntax is correct.
>
>Please HELP!!!!!
Hi Pamela,
Don't know about PrintTitleRows
but orientation line have to look like:
ObjExcel.ActiveSheet.Pagesetup.Orientation = xlLandscape
or
ObjExcel.ActiveSheet.PageSetup.Orientation = 2 && landscape
Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison