Results 1 to 7 of 7
  1. #1
    Lounger
    Join Date
    Mar 2002
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Excel object embedded in html (11.0)

    I would like to embed an excel object into a web page with something like

    <object classid="clsid:00020812-0000-0000-C000-000000000046"
    type="application/x-oleobject"
    width="200" height="300" name="MyExcel"
    >
    </object>

    I cannot find any reasonable examples how to do this.
    Can anybody in the lounge offer any hints?

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel object embedded in html (11.0)


  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Excel object embedded in html (11.0)

    Microsoft supplies a set of OWCs (Office Web Components) that enable you to do this. They don't have the full functionality of the applications, of course, but they go a long way. The rules for when and to whom you can redistribute OWCs are a bit messy. For more confusion, see General information about the licensing and the use of Office 2003 Web Components. For reference, I have attached the results of creating a new page in FrontPage 2002 and choosing Insert>Web Component>Spreadsheet. Maybe this helps?
    Attached Files Attached Files

  4. #4
    Lounger
    Join Date
    Mar 2002
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel object embedded in html (11.0)

    Thanks to the ;links I got so far I managed quite a bit,
    but I am still facing problems.

    The following html page works in Internet Explorer,
    but not fully in Firefox.

    To be able to use ActiveX in Firefox at all
    one has to install the ActiveX plugin for Mozilla from
    http://www.iol.ie/~locka/mozilla/mozilla.htm
    The version for Firefox 1.04 also works with Firefox 1.06
    Additionally, one has to add the 2 entries
    pref("capability.policy.default.ClassID.CID0002E55 9-0000-0000-C000-000000000046",
    "AllAccess");
    pref("capability.policy.default.ClassID.CID0002E55 D-0000-0000-C000-000000000046",
    "AllAccess");

    to the file
    C:Program FilesMozilla Firefoxdefaultsprefactivex.js

    In IE, everything works fine.
    In Firefox, the Excel sheet will work,
    but the chart will not display any data.

    Any ideas what needs to be changes in my file?


    -=-=-=-=-==-=-=-=-=-=

    <html>
    <head>
    <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
    <meta name=ProgId content= FrontPage.Editor.Document >
    <meta name=Generator content="Microsoft Excel 9" >

    </head>

    <script type='text/javascript'>

    function l() {

    excel.DisplayToolbar = false;

    excel.range('a1' ).formula = 1;
    excel.range('a2' ).formula = 2;
    excel.range('a3' ).formula = 3;
    excel.range('b1' ).formula = 10;
    excel.range('b2' ).formula = 15
    excel.range('b3' ).formula = 18
    }


    function create_chart() {

    var xlLineMarkers = 65;
    var xlColumns = 2;

    var chDimSeriesNames = 0;
    var chDimCategories = 1;
    var chDimValues = 2;
    var chDimXValues = 4;

    chart.Charts.Add();

    chart.ChartType = xlLineMarkers;
    chart.DataSource = excel//;.Range("A1:B3");
    var s = chart.Charts(0).SeriesCollection;

    var data_series = s.Add();

    data_series.SetData(chDimCategories, 0, "A1:A3");
    data_series.SetData(chDimValues, 0, "B1:B3");

    return false;
    }



    </script>

    <body onLoad='l();'>


    <object
    width = 300
    height = 400
    id = 'excel'
    classid = 'CLSID:0002E559-0000-0000-C000-000000000046'>

    <param name=DisplayTitleBar value=false >
    <param name=ViewableRange value='a1:b12'>
    <param name=AutoFit value=true >
    </object>




    and now the chart
    </p>

    <form>
    <input type=submit onclick='return create_chart()' value='Create Chart'>
    </form>


    <object
    width = 300
    height = 400
    id = 'chart'
    classid = 'CLSID:0002E55D-0000-0000-C000-000000000046'>
    </object>

    </body>
    </html>

  5. #5
    Lounger
    Join Date
    Mar 2002
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel object embedded in html (11.0)

    Thanks for the Frontpage generated code. I do not have Frontpage installed, so this is very helpful.
    I have one more question: do you know how the embedded Excel object also can open
    an XLS files which resides in the same place as the html file? What would solve all my problems
    woudl be having a spreadsheet window and a chart windows on the same page
    which are just views on different sheets in the same workbook which the
    user also downloads from my website.

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Excel object embedded in html (11.0)

    I personally do not allow any ActiveX controls to run in Firefox and have no plans to install an extension that would do so. Hopefully someone else can do some testing with you on that scenario.

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Excel object embedded in html (11.0)

    This is very far outside my own experience. Some Googling suggests that you can (1) save a web page with a static chart out of your Excel workbook, or (2) let the user chart your data herself by saving your worksheet "with interactivity." I also saw a page suggesting that when you publish a data access page from MS Access, it uses the spreadsheet component. Perhaps seeing the code of one of those pages would show how to do access to an external file.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •