The problem now is when I created a Button2 with simlar macro but chart name changed toTestChart2.jpeg, the chart name in macro in Button1 will be changed to TestChart2.jpeg as well.
I need each Button to have a different chart name to be exported. Any suggestions would be much appreciated!
I would use only a single button, which read the required charts (possible values from a extra field - created per inline-load) and run within a loop the export-routine. For code-snippets to read fields and using loops see APIGuide.qvw.