Results 1 to 4 of 4
  1. #1
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exporting graphs from Excel

    Hi,

    My apologies for asking this question again. I posted this question on the ikonboard forum, but the board disappeared. I did get a reply which looked promising, but I did not get a chance to investigate. My apologies to the helpful person who replied.[img]/w3timages/icons/sad.gif[/img]

    I have been exporting graphs as gifs for use on the Intraweb. I have also been publishing sections of Excel documents as HTML and showing them on the web. What I would like to do (if it's at all possible) is to give the ability for the user to highlight a particular piece of a graph, and for it to pop-up the value of that piece of the graph, in the same way that Excel does.

    I have seen in the help files that it's possible to publish graphs rather than to export them. I haven't been able to get this to work though. So my two questions are:
    .Can I do it?
    .Is it worth it? (ie, will I be able to achieve what I want, or will it just give me static gifs anyway?)

    For publishing the sections of the spreadsheet, I used:

    ActiveWorkbook.PublishObjects.AddxlSourceRange, "filename.htm", _
    "", "section_name, xlHtmlStatic, "", "").Publish (True)).

    TIA

    Geoff
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    5,891
    Thanks
    0
    Thanked 81 Times in 77 Posts

    Re: Exporting graphs from Excel

    Hi Geoff,
    This is the code I published on the other board:
    Function publishchart(strPubFileName As String, strSheetName As String) As Boolean
    Dim pboPublish As Excel.PublishObject
    Set pboPublish = ActiveWorkbook.PublishObjects.Add(xlSourceChart, _
    strPubFileName, strSheetName, _
    "", xlHtmlChart)
    ' Set title for Web page and publish.
    With pboPublish
    .title = strSheetName
    .Publish True
    End With
    publishchart = True
    End Function
    Basically the only difference is that I've used xlHTMLChart rather than xlHTMLStatic. This does give you a dynamic chart in the sense that if you publish the source data as well, you can change it and the chart will update, but I don't think it will show data values if you hover the cursor over a point. (I may be wrong as I've never actually used this properly, your post stirred my curiosity!)
    Hope that's of some help.
    Regards,
    Rory
    Microsoft MVP - Excel.

  3. #3
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Exporting graphs from Excel

    Rory,

    Great! Thanks for the response.

    I'll be saving this one before it gets lost again (but I'm *SURE* this forum isn't going to get lost).

    Thanks agian

    Geoff
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    5,891
    Thanks
    0
    Thanked 81 Times in 77 Posts

    Re: Exporting graphs from Excel

    I hope not having just re-entered it in my favourites (probably a bad move, as soon as I did that with the Ikonboard, look what happened!)
    Regards,
    Rory
    Microsoft MVP - Excel.

Posting Permissions

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