OLE automation in javascript (automation server cannot create object)
I'm trying to instantiate an excel object through ole automation in client-side javascript using.
var obj = new ActiveXObject(Excel.Application);
It is working fine if I run this simple .htm file, with client-side javascript code, from local C or D drive. but when i place this file on wwwroot, an exception occurs, "automation server cannot create object" at the obove mentioned line.
So is this a problem with some permission required for IIS to create an ole Object??. If this is so, Please respond for how to grant these permissions, or if it is a different problem?
Thanks a lot.
Re: OLE automation in javascript (automation server cannot create object)
Quote:
Originally Posted by farhanh
Thanks a lot Satish
It solved my problem.
and thanks for making my concepts more clear. :)
How did you solve the problem?
Re: OLE automation in javascript (automation server cannot create object)
Quote:
Originally Posted by imad1406
How did you solve the problem?
Hii ...
would you tel me plz... how did u fix the problem.. for (automation server cannot create object)
Thanks waiting for ur kind reply
Re: OLE automation in javascript (automation server cannot create object)
Welcome to the forums, ahmadriyaz. Please remember that when you have a problem, to create a new thread and post your problem. You will notice that the original poster wrote this 4 years ago. You will most likely not hear back from him.
But, if you would have read the whole thread, you would have seen that the solution was given. You need to change security levels to a custom level when running on a web server due to security reasons. A script running on a local machine receives less security precautions.
You can change these settings here.
Code:
Tools Menu -> Internet Options -> Security -> Custom level
Re: OLE automation in javascript (automation server cannot create object)
hi,
can you please give details on how u resolve this bug. i am getting same issue with my aspx page.
please give which option i have to enable and disble after clicking on the customlevel in security tab.
thanks...
venkat.
Re: OLE automation in javascript (automation server cannot create object)
That all depends on what your scripts are attempting to run. Why don't you set them all really low, and then one-by-one move them up. Then you can eliminate which ones are necessary.
You will need to focus on ActiveX components.
Re: OLE automation in javascript (automation server cannot create object)
thak you... i am checking the same way. let c how it goes..
Re: OLE automation in javascript (automation server cannot create object)
Just stumbled across this post and thought I'd post this in case anyone still needed it or someone new ran across it in the future... the setting that will allow the ActiveX object to be created is:
Tools Menu -> Internet Options -> Security -> Custom level -> "Initialize and script ActiveX controls not marked as safe for scripting"
This needs to be set to "enabled" for it to work. This is however a huge security issue and therefore if you absolutely must do this I would only recommend that you apply it to the "trusted sites" security zone and list the site you need it to work on as a member of that zone. If you are trying to get this to work on a local dev box then simply enter http://localhost as a trusted site and enable this setting for the trusted sites zone.
Re: OLE automation in javascript (automation server cannot create object)
Welcome to the forums, Syllus. Please remember to make your posts more relevant. This thread is almost 5 years old.