|
-
July 22nd, 2003, 05:00 AM
#1
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.
-
July 22nd, 2003, 12:28 PM
#2
The problem is not with IIS as IIS is not involved when your client side script is executing.
You need to set the permissions for IE so that your script will execute. I am not sure of the exact change to be made.
Check out in Tools -> Internet Options - >Security - > Custom level
Satish
-
July 22nd, 2003, 01:47 PM
#3
The point is that when i run this script from a local C or D drive
as C:\test.htm, it runs fine and creates the object perfactly.
the thing is that if the problem is with IE, how is it doing fine this way.
But when i place the same code at wwwroot, and try to request it from http://localhost/test.htm, the message says "automation server can't create object".
Please respond to clear things up, and if you still think that the problem is with IE, kindly tell the exact procedure.
Thanks a lot.
-
July 22nd, 2003, 04:07 PM
#4
I get your point....
This is because of IE's security mechanism, which allows for different securoty settings for Local intranet, internet, trusted sites etc. So when you are running the script from an HTML on your local disk, the browser considers this to be secure and allows it to run.
When you run it from wwwroot, I guess it would come under local intranet and would have a different set of permissions.
Unfortunately I can tell you the exact setting that you need to make as the organisation I work with locks the Internet Options menu for IE on our machines. So I cant try out and let you know.
However, it should be quite easy to do.
Satish
-
July 23rd, 2003, 07:30 AM
#5
Thanks a lot Satish
It solved my problem.
and thanks for making my concepts more clear.
-
March 20th, 2005, 04:44 AM
#6
Re: OLE automation in javascript (automation server cannot create object)
 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?
-
June 20th, 2007, 03:26 AM
#7
Re: OLE automation in javascript (automation server cannot create object)
 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
-
June 20th, 2007, 07:32 AM
#8
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
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
January 23rd, 2008, 05:09 AM
#9
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.
-
January 23rd, 2008, 08:25 AM
#10
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.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
January 24th, 2008, 01:12 AM
#11
Re: OLE automation in javascript (automation server cannot create object)
thak you... i am checking the same way. let c how it goes..
-
April 4th, 2008, 02:13 PM
#12
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.
-
April 4th, 2008, 04:22 PM
#13
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.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|