Once again, the QlikCommunity is a very good place to start. Just dig a bit deeper on what you want to do and you will find lots of examples. The structure of the QlikView objects is in the APIGuide.qvw and the Automation Reference, although the latter is pretty small. The rest of the language is usually VBScript, for what you can find a lot of information in the Microsoft website.
Just as a reminder, QlikView improves its object actions every version, and there are a lot of things you can now do just right clicking on the object and going to the Actions tab or in the Settings menu, Document Properties, Triggers tab (open a new file, minimize, maximize, set a variable, just to mention a few...).
How to debug the macro script in qlikview. One way of the doing it is insert some check points and click on the debug button then press 'f8'. May I know is there is any other way of doing it? As I didn't work much on macro coding finding it difficult to understand whats wrong with the existing coding.