First, using a heavy weight application, like Excel, to call a couple of Win32 API's is ridiculous. Also, going back to the original context of the question, the script, running in a browser, can NOT create an instance of Excel. COM-interop is off-limits because of security concerns. It's also the reason ActiveX is no longer supported by browsers.
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave Kreskowiak