none
adds-in of power point 2013 crash when new XMLHttpRequest invoke open in javascript RRS feed

  • Question

  • the adds-in can work well before version  ppt2010, but when i deploy it in the ppt2013, in js codes, xmlHttp.open("GET", url, true)  will crash catch exception "object error" "undefined".

    Please help me, i am sticked for two days.

     if (window.XMLHttpRequest) {
       xmlHttp = new XMLHttpRequest();
       if (xmlHttp != null)           
          alert("xmlhttprequest ok!");
    }
    else if (window.ActiveXObject) 
    {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    if (xmlHttp != null)           
          alert("Microsoft xmlhttp ok!");
    }

        .....................................

    xmlHttp.open("GET", url, true);  /////////crash here. object undefined

    Tuesday, November 19, 2013 4:01 AM

All replies

  • the adds-in can work well before version  ppt2010, but when i deploy it in the ppt2013,  xmlHttp.open("GET", url, true)  will crash.

    Please help me, i am sticked for two days.

     if (window.XMLHttpRequest) {
       xmlHttp = new XMLHttpRequest();
       if (xmlHttp != null)           
          alert("xmlhttprequest ok!");
    }
    else if (window.ActiveXObject) 
    {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    if (xmlHttp != null)           
          alert("Microsoft xmlhttp ok!");
    }

        .....................................

    xmlHttp.open("GET", url, true); /////////crash here. object undefined

    Monday, November 18, 2013 9:25 AM
  • does somebody can help me?it just do not work in 2013 anyhow i modify the ppt 2013 setting.
    Wednesday, November 20, 2013 1:45 AM
  • Hi Kenton,

    What’s kind of add-in you are developing? A VSTO PowerPoint add-in?

    Since you said “in js codes” and you provide the JS code, it means there are some JavaScript codes in your add-in. As far as I know, you could use C# or VB.NET programming language in VSTO add-in project rather than JavaScript.

    In addition, only the apps for office could support the JavaScript language, but the apps for office can be applied in Office 2013 rather than Office 2010.

    So could you provide more detail information about your add-ins?

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, November 20, 2013 11:39 AM
    Moderator
  • Hi Fei:

    Thanks for your replying.

    I new a shared add-in of ppt with VC++/ATL,  put a html in a htmlDialog, so when click a button after open a ppt file, the html dialog will popup, and in the html use javascript new XMLHttpRequest(), the newed object can open url in ppt2007,ppt2010 but, when invoke open in 2013, it will fail. and catch the exepction show "object error"

     if (window.XMLHttpRequest) {
       xmlHttp = new XMLHttpRequest();
       if (xmlHttp != null)           
          alert("xmlhttprequest ok!");
    }
    else if (window.ActiveXObject) 
    {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    if (xmlHttp != null)           
          alert("Microsoft xmlhttp ok!");
    }

    .....

    .........

    ..............

    xmlHttp.open("GET", url, true);  /////////crash here. object undefined in ppt 2013

    I import ppt with below style in the stdafx.h.

    using namespace ATL;
    #import <C:\Program Files\Common Files\Designer\MSADDNDR.DLL> raw_interfaces_only, raw_native_types, no_namespace, named_guids, auto_search

    #ifdef  ADDIN
    #import <Microsoft Shared\OFFICE11\mso.dll> rename_namespace("Office")
    #else
    #import <C:\Program Files\Common Files\Microsoft Shared\OFFICE12\mso.dll> rename_namespace("Office")
    #endif
    using namespace Office;

    #import <C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.olb> rename_namespace("VBE6")
    using namespace VBE6;

    //For coincidence code of svn, about the following #import, we use relative path. 
    //So you need to add setup dir of your office to PATH(environment variable). 
    // setup dir of your office, for example is C:\Program Files\Microsoft Office.
    #ifdef   ADDIN
    #import <Office11\MSPPT.OLB> named_guids,rename_namespace("MSPPT")
    #else
    #import "libid:91493440-5A91-11CF-8700-00AA0060263B" named_guids,rename_namespace("MSPPT")


    • Edited by Kenton.tsui Thursday, November 21, 2013 3:18 AM concrete the content
    Thursday, November 21, 2013 3:01 AM
  • does anybody help me?? thanks
    Monday, November 25, 2013 1:43 AM