DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    fareeda Guest

    Re: display excel spreadsheet charts on webpage: the SOLUTION


    hello,
    thank you vince for your response. i checked the article you referred me
    to. it was helpful. i also found a very simple SOLUTION to displaying individual
    charts on a webpage. i decided to post the code so that it may help those
    who are having the same problem.

    this is what you do:
    open a connection to your excel workbook from your webpage.
    set the chart spreadsheet you wish to see to "visible".
    set all other spreadsheets to hide.
    set your workbook as read-only if you don't want users to change your data/charts.

    here is a sample code:

    <html><head>

    <script language=vbscript>

    Dim objExcel

    Sub chartsheet_onclick()
    call OpenWorkbook("c:\test\testfile.xls")
    End Sub

    Sub OpenWorkbook(strLocation)

    Set objExcel = CreateObject("Excel.Application")
    objExcel.Visible = true
    objExcel.Workbooks.Open strLocation
    objExcel.UserControl = true
    objExcel.Sheets("chart").Visible = True
    objExcel.Sheets("sheet1").Visible = False
    objExcel.Sheets("sheet2").Visible = False
    objExcel.Sheets("sheet3").Visible = False

    End Sub

    </script>

    <title></title></head><body><br>

    this is a test page for displaying an excel chart...
    <br><br>

    <input type=button name=chartsheet value="display excel chart">

    </body></html>

    fareeda

    "Vince" <vince@vas3.com> wrote:
    >
    >Link to an answer to this question, may help.
    >
    >http://news.devx.com/cgi-bin/dnewswe...tem=9154&utag=
    >
    >"fareeda" <servers52@hotmail.com> wrote:
    >>
    >>hello,
    >>i have excel spreadsheets that contain charts and graphs. i want to display
    >>those charts on a webpage WITHOUT having to convert the charts into HTML
    >>files. what is the best and easy way to do this? i tried to create a

    link
    >>to the charts using the <a href = ...> html method. it linked the workbook
    >>but not the spreadsheet. i want to link ONLY the spreadsheets. something
    >>like this: <a href='[c:\windows\desktop\test.xls]chart'> this didn't work.
    >> any idea??? can javascript/vbscript coding do the job? what's a good

    >way
    >>to do this?
    >>
    >>thank you,
    >>fareeda

    >



  2. #2
    Krishna Guest

    Re: display excel spreadsheet charts on webpage: the SOLUTION


    Hi
    How did you specify the strlocation in your code if the file is on a different
    server rather than on your desktop and also if your html/asp file is being
    hosted on a different server.. my excel file is on a Novell based network
    server and asp pages on a windows based server..

    Any help is highly appreciated...

    "fareeda" <servers52@hotmail.com> wrote:
    >
    >hello,
    >thank you vince for your response. i checked the article you referred me
    >to. it was helpful. i also found a very simple SOLUTION to displaying

    individual
    >charts on a webpage. i decided to post the code so that it may help those
    >who are having the same problem.
    >
    >this is what you do:
    >open a connection to your excel workbook from your webpage.
    >set the chart spreadsheet you wish to see to "visible".
    >set all other spreadsheets to hide.
    >set your workbook as read-only if you don't want users to change your data/charts.
    >
    >here is a sample code:
    >
    ><html><head>
    >
    ><script language=vbscript>
    >
    >Dim objExcel
    >
    >Sub chartsheet_onclick()
    >call OpenWorkbook("c:\test\testfile.xls")
    >End Sub
    >
    >Sub OpenWorkbook(strLocation)
    >
    >Set objExcel = CreateObject("Excel.Application")
    >objExcel.Visible = true
    >objExcel.Workbooks.Open strLocation
    >objExcel.UserControl = true
    >objExcel.Sheets("chart").Visible = True
    >objExcel.Sheets("sheet1").Visible = False
    >objExcel.Sheets("sheet2").Visible = False
    >objExcel.Sheets("sheet3").Visible = False
    >
    >End Sub
    >
    ></script>
    >
    ><title></title></head><body><br>
    >
    >this is a test page for displaying an excel chart...
    ><br><br>
    >
    ><input type=button name=chartsheet value="display excel chart">
    >
    ></body></html>
    >
    >fareeda
    >
    >"Vince" <vince@vas3.com> wrote:
    >>
    >>Link to an answer to this question, may help.
    >>
    >>http://news.devx.com/cgi-bin/dnewswe...tem=9154&utag=
    >>
    >>"fareeda" <servers52@hotmail.com> wrote:
    >>>
    >>>hello,
    >>>i have excel spreadsheets that contain charts and graphs. i want to display
    >>>those charts on a webpage WITHOUT having to convert the charts into HTML
    >>>files. what is the best and easy way to do this? i tried to create a

    >link
    >>>to the charts using the <a href = ...> html method. it linked the workbook
    >>>but not the spreadsheet. i want to link ONLY the spreadsheets. something
    >>>like this: <a href='[c:\windows\desktop\test.xls]chart'> this didn't

    work.
    >>> any idea??? can javascript/vbscript coding do the job? what's a good

    >>way
    >>>to do this?
    >>>
    >>>thank you,
    >>>fareeda

    >>

    >



  3. #3
    Greg Guest

    Re: display excel spreadsheet charts on webpage: the SOLUTION


    You can just use a fully qualified path name such as \\myNovellServer\myfile.xls

    "Krishna" <sahari101@yahoo.com> wrote:
    >
    >Hi
    >How did you specify the strlocation in your code if the file is on a different
    >server rather than on your desktop and also if your html/asp file is being
    >hosted on a different server.. my excel file is on a Novell based network
    >server and asp pages on a windows based server..
    >
    >Any help is highly appreciated...
    >
    >"fareeda" <servers52@hotmail.com> wrote:
    >>
    >>hello,
    >>thank you vince for your response. i checked the article you referred

    me
    >>to. it was helpful. i also found a very simple SOLUTION to displaying

    >individual
    >>charts on a webpage. i decided to post the code so that it may help those
    >>who are having the same problem.
    >>
    >>this is what you do:
    >>open a connection to your excel workbook from your webpage.
    >>set the chart spreadsheet you wish to see to "visible".
    >>set all other spreadsheets to hide.
    >>set your workbook as read-only if you don't want users to change your data/charts.
    >>
    >>here is a sample code:
    >>
    >><html><head>
    >>
    >><script language=vbscript>
    >>
    >>Dim objExcel
    >>
    >>Sub chartsheet_onclick()
    >>call OpenWorkbook("c:\test\testfile.xls")
    >>End Sub
    >>
    >>Sub OpenWorkbook(strLocation)
    >>
    >>Set objExcel = CreateObject("Excel.Application")
    >>objExcel.Visible = true
    >>objExcel.Workbooks.Open strLocation
    >>objExcel.UserControl = true
    >>objExcel.Sheets("chart").Visible = True
    >>objExcel.Sheets("sheet1").Visible = False
    >>objExcel.Sheets("sheet2").Visible = False
    >>objExcel.Sheets("sheet3").Visible = False
    >>
    >>End Sub
    >>
    >></script>
    >>
    >><title></title></head><body><br>
    >>
    >>this is a test page for displaying an excel chart...
    >><br><br>
    >>
    >><input type=button name=chartsheet value="display excel chart">
    >>
    >></body></html>
    >>
    >>fareeda
    >>
    >>"Vince" <vince@vas3.com> wrote:
    >>>
    >>>Link to an answer to this question, may help.
    >>>
    >>>http://news.devx.com/cgi-bin/dnewswe...tem=9154&utag=
    >>>
    >>>"fareeda" <servers52@hotmail.com> wrote:
    >>>>
    >>>>hello,
    >>>>i have excel spreadsheets that contain charts and graphs. i want to

    display
    >>>>those charts on a webpage WITHOUT having to convert the charts into HTML
    >>>>files. what is the best and easy way to do this? i tried to create

    a
    >>link
    >>>>to the charts using the <a href = ...> html method. it linked the workbook
    >>>>but not the spreadsheet. i want to link ONLY the spreadsheets. something
    >>>>like this: <a href='[c:\windows\desktop\test.xls]chart'> this didn't

    >work.
    >>>> any idea??? can javascript/vbscript coding do the job? what's a good
    >>>way
    >>>>to do this?
    >>>>
    >>>>thank you,
    >>>>fareeda
    >>>

    >>

    >



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links