in reply to change value in run time

If the main job is retrieving a query and exporting it as an Excel file, I'm very fond of Querylet, which mostly does Just That. It has its drawbacks, as it is a source filter, but it can write Excel files through both, Spreadsheet::WriteExcel (which is slow and uses lots of memory, but works without Excel installed) and native Excel through Win32::OLE (which is fast but requires Excle to be installed).