Results 1 to 2 of 2

Thread: Error in the Excel object usage in ASP

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 1999
    Posts
    23

    Post

    I am trying to create a .gif on the fly using the Excel component with the following code.

    Set xlSheet = CreateObject("Excel.Sheet")
    Set xlApp = xlSheet.Application
    Set Wrk = xlApp.Worksheets.Add

    Wrk.Range("A1:A1").Insert
    Wrk.Range("A1:B1").Insert
    Wrk.Range("A1:C1").Insert
    Wrk.Range("A1 1").Insert
    Wrk.Range("B1:A1").Insert
    Wrk.Range("B1:B2").Insert
    Wrk.Range("B1:C3").Insert
    Wrk.Range("B1 4").Insert

    Wrk.Range("A1:A1").Value = 1
    Wrk.Range("A1:B1").Value = 2
    Wrk.Range("A1:C1").Value = 3
    Wrk.Range("A1 1").Value = 4
    Wrk.Range("B1:A1").Value = 50
    Wrk.Range("B1:B2").Value = 100
    Wrk.Range("B1:C3").Value = 120
    Wrk.Range("B1 4").Value = 70

    Set ActiveChart = Wrk.ChartObjects.Add(1, 1, 100, 100).Chart
    ActiveChart.ChartType = 65
    ActiveChart.HasDataTable = False
    ActiveChart.Export "c:\Mychart GIF", "GIF"

    The above code works well in Visual Basic but gives an error in the last line if it is run as an ASP file. Please help

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    Why don't you export the chart to the dir in which the web page is being processed?

    ex: c:\inetpub\wwwroot\..... or similar....

    It might have something to do with permissions of your page writing to the local file system on the web server

    HTH

    Tom

Posting Permissions

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



Click Here to Expand Forum to Full Width