Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you set an Excel Header?
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00189300
Message ID:
00189323
Views:
11
>I am creating a spreadsheet with the following code:
>
>ExcelObj = CreateObject('Excel.Application')
>ExcelObj.Visible = .T.
>ExcelObj.Workbooks.Add
>ExcelBook = ExcelObj.ActiveWorkbook
>ExcelSheet = ExcelBook.Activesheet
>
>I have no problem filling the spreadsheet, but I am having a hard time finding out how to put in the title of the spreadsheet. In excel, it would be under Page Setup/Custom Header. Can anyone help with the syntax?
>
>Thanks,
>
>Mark

Mark,

WITH ExcelObj.ActiveWorkbook.ActiveSheet.Pagesetup
.LeftHeader = "MyLeftHeader"
.CenterHeader = "MyCenterHeader"
.RightHeader = "MyRightHeader"
ENDWITH

The same goes for footer.

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
Previous
Reply
Map
View

Click here to load this message in the networking platform