Like Arend said...That error usually lead to syntax error. Maybe start commenting out large chunks of the script until it works to narrow it down.

Sorry I would help more, but I don't have the kixforms dll registered on my work computer.