Copy of Anton Scheffer's as_xlsx package modified as follows:
Refactored to separate query2sheet into a "query2sheet" that does the parse and a "cursor2sheet" that does the main work
The "cursor2sheet" can then be called from "refcursor2sheet" which converts a refcursor to a DBMS_SQL cursor.
"refcursor2sheet" relies on 11g functionality
and uses conditional compilation so it is only enabled in that version but can be compiled in 10g.