Hi Haroon,
In the Analysis View, I created a New Excel Report, there I inserted a SQL Query for two worksheets (the first is the source data and the second is just SELECT ' ' FROM DUAL (it is intended for the reporting generated by the macro).
Then I wrote the VBA macro in the Post-processing tab in QC and checked the checkbox Run post-processing. Then I click on Generate and the Excel file is generated just fine, everything is nicely formatted but the code used to generate the Excel file is not present in a module in the Excel file generated (that is why the buttons also generated do not work - no code is attached to them).
I would like the code present in the Post-processing tab in QC to be copied to a module of the generated Excel file, so the buttons work.
Tha goal is actually that the business people only click on the button Generate in QC and everything is generated automatically, no copy paste after, only some filters and buttons easy to use.
What do you think?
I add the code if you find it useful - see attached file. And thank you again :)