i don't use macros but if you just want to export invoice headers etc, then their is a prescribed csv format - look at import/export transactions to get the format
if you actually need to write INVOICE LINES then you can't do this via a csv, and you HAVE to have a sage developer licence, or get someone who has one to do it for you