Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically Setting Headers in Excel with FoxPro

Status
Not open for further replies.

ontsjc

Technical User
May 17, 2000
113
Hello All,

Hopefully this is a quick question. I have a client who wants their deliverables sent to them in Excel format. I'm using FoxPro V.6 to bring in the data into excel and format it for printing. Everything works great except setting the font for the header and adding in the page number variables. I can bring in the header text as a string, but can not figure out how to format these other codes so that excel will execute them instead of just print them out as text in the header. Excel's Macro recorder gives me this snippet of code for how it builds the header:

ActiveSheet.PageSetup.CenterHeader = _"&""Times New Roman,Bold""&12ANALYTICAL SUMMARY REPORT" & Chr(10) & "March 14, 2001" & Chr(10) & "Page &P of &N"

This produces a header in Bold Times New Roman, with 12 point type, and places in page numbers and total pages. Any help, any at all, would be greatly appreciated.
 
Hi ontsjc,

lcString = chr(38)+'"Times New Roman,Bold"'+chr(38)+'12ANALYTICAL SUMMARY REPORT'+chr(10)+'March 14,2000'+chr(10)+'Page '+chr(38)+'P of '+chr(38)+N'

oXL.ActiveSheet.CenterHeader=lcString Jon Hawkins

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
Thanks Jon. For the life of me I couldn't figure that out.

-Steve Cole


Meet the new boss,
Same as the old boss -Pete Townsend
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top