Problem on the ASP using the Excel.Application Object

Ask a Question related to ASP Components, Design and Development.

  1. #1

    Default Problem on the ASP using the Excel.Application Object

    Hi, All:
    I want to use excel component in the ASP.
    My code is that
    -----------------------------------------------------------
    Dim oExcel As Object
    Dim oBook As Object
    Dim oSheet As Object

    'Start a new workbook in Excel
    Set oExcel = CreateObject("Excel.Application")
    Set oBook = oExcel.Workbooks.Add

    'Add headers to the worksheet on row 1
    Set oSheet = oBook.Worksheets(1)
    oSheet.Range("A1:C1").Value = Array("ORD0001", "Amount", "Tax")

    'oSheet.Range("A2:A100").
    oSheet.Range("A1").FormatConditions.Add(xlCellValu e, xlEqual,
    "ORD0001").Font.Bold = True


    'Save the Workbook and Quit Excel
    oBook.SaveAs "C:\Book1.xls"
    oExcel.Quit
    -------------------------------------------------------
    But the function FormatConditions seems no use.


    So I test this code in Visual Basic 6.0. I find the error is that

    oSheet.Range("A1").FormatConditions.Add(xlCellValu e, xlEqual,
    "ORD0001").Font.Bold = True

    Run-time error 5: invalidate procedure call or argument


    Then I open the menu Project -> Preference, and add the "Microsoft Excel
    10.0 Object Library".


    Then the visual basic code could run successfully.

    ---------------------------------------------------------
    My question is that.
    How to make the ASP code run ?
    How to add the "Microsoft Excel 10.0 Object Library" in asp using the above
    code?

    Thanks















    David Huang Guest

  2. Similar Questions and Discussions

    1. COM Object Excel
      Hi, I was using a Coldfusion 4.5 server on a windows NT platform on which I was exporting datas in a Excel 97 using COM object. I've migrated all...
    2. Excel.Application
      Hi I want to show a excel workbook trough my webserver using ASP. Wich dll's do I have to register in the webserver for this to work? Anyone...
    3. How to save a excel workbook in a web application
      I used the following code to create a workbook and save it in a webapplication. dim oExcel As Excel.ApplicationClass dim oBook As...
    4. Excel object in ASP
      I am trying to use an excel spreedsheet on an asp.net page. The follow code works (with output mod.) in a .net console application. When I try to...
    5. QueryInterface, with the object Excel.Application
      Hello, With Asp.Net, I try to generat a document with an Excel object. This is the begin of my procedure: Dim xapExcel As Excel.Application...
  3. #2

    Default Re: Problem on the ASP using the Excel.Application Object

    Please do not multipost.

    Ray at home

    "David Huang" <chenchun.huang@hp.com> wrote in message
    news:cyZhc.222$EQ4.61@news.cpqcorp.net...
    > Hi, All:
    > I want to use excel component in the

    Ray at Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139