Re: How to write "worksheet.metadata.customitems.item(2)" into Header?
Sorry, no. At least, not in any easy way. You can't access the header or footer from the automation intreface. It might be possible to do it by modifing the XML of the file, but that's a lot of work (and almost certainly will not work if the file is open in Mathcad).