Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1346
  • Last Modified:

500pnts!! - GetObject In Javascript

I have the following script in an aspx in a client script section.

<html>
<script language="javascript">
var oXlApp;

function getExcelInstance()
{
  try
  { // this never works even if excel is running
    oXlApp=GetObject("","Excel.Application.11")
    alert("Get Object Works!!");
  }
  catch(ex)
  {
    alert("Get Object Failed:- "+ex.message);
    try
    {
      oXlApp=new ActiveXObject("Excel.Application.11");
      alert("ActiveXObject Works!!");
    }
    catch(ex)
    {
      alert("ActiveXObject Failed:- " + ex.message);
            }
  }
}
</script>
<body>
  <input type="button" onclick="getExcelInstance();" value="clickMe" ID="Text1" NAME="Text1"/>
</body>
</html>

The GetObject never works even if there is a running instance which there is after the 1st time hitting the button. I get Automation Server Can't Create Object. The activeXObject then fires and I get an instance of excel for each button click.

I've got a really urgent deadline and this is my last bug!! Surely an easy 500pnts for someone out there!

TIA

This is really urgent as I've got
0
GillyTheTaffy
Asked:
GillyTheTaffy
1 Solution
 
radevoCommented:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q239470

"Cannot Call GetObject from Script in IE to Access Running Object
...
Calling GetObject to get a running ActiveX object on a client system would be a large security risk because any running object on the system could be accessed without direct user permission, and is therefore not allowed by Internet Explorer. There is no way to change this behavior, either through code or manually by an end user.
"
0
 
GillyTheTaffyAuthor Commented:
that is the worst correct answer I have ever had - but thanks for confirming that for me
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now