Set Size of Header in Excel

I cannot figure out how to set the size of a header or for that matter footer in an Excel spread sheet . Everything I have tried tells me I cannot set a page setup object to font size.

This is what I have .


tell application "Microsoft Excel"
	tell page setup object of active sheet
		set page orientation to landscape
		set left margin to ".5"
		set right margin to ".5"
		center vertically
		center horizontally
		set center header to "Test"
		set zoom to false
		set fit to pages wide to 1
		set fit to pages tall to 1
	end tell
	print out active sheet
end tell


Since posting this request I discovered you can embed a number of commands in the “Set center header --” command such as &B for Bold &A worksheet name etc. These all came from a Microsoft Reference document of 2004 which included &nn for font size but that does not work in fact &N (capital) returns the number of pages but &nn returns 1n (my document only has one page) followed by lowercase n.

Just wanted to update my request for help.

You don’t use &nn, you use & followed by a two-digit number that indicates the font size you want. The format codes are case insensitive, so &N is the same as &n, etc.

Like this:


tell application "Microsoft Excel"
	
	tell active workbook
		tell active sheet
			set left header of page setup object to "&20Page Header"
		end tell
	end tell
	
end tell

Thank you so much worked as you said it would. Went back and looked at the instructions and I guess everyone but I would have seen the “&nn” as place holders given all the other commands were in capitals albeit as you say case insensitive…

Learn something every day, again thank you.