Hi,
The pre/requisite to use Excel API class is are:
1) Should be run in a windows env. Hence the batch server should be windows, in Unix these commands will not work
2) MS Excel should be installed in the windows machine. If not, then calling createobject for Excel application will throw exceptions since there is no underlying excel libraries to handle the call.
To test your AE works or not, you can try running AE in 2 tier i.e directly from Application designer assuming your work env machine is windows with excel installed. The code should work properly there.