I finally managed to get (part of it) working, thank you!
The export part now works, however I have a small question. Using the innate export button, there is the option of getting the document to open after the operation is complete automatically. Is it possible to code this in?
My second question is something I have still not managed to successfully implement. The button still shows up on every tab, even though I only create it under f.ex, Products. (I would like an export button on most tabs, but not all, hence the problem, also the placement of it).
My final question, is there a reason the export does not show up in the same format as in the database? By this I mean, shading, boxing, gridlines. I hope you understand what I mean here.
Thank you for all the help so far.