error BC30002: Type Excel.Application is not Defined

Discussion in 'ASP .Net' started by Mel, Aug 10, 2007.

  1. Mel

    Mel Guest

    Can anyone tell me why I am getting this error? It bombs on this line
    of my VB code:
    Public appExcel As New Excel.Application

    It works when I test it on my machine but once I release the page to
    the web server I get the error when I click on a hyperlink that loads
    the page. I have the Interop.Excel and Interop.Microsoft.Office.Core
    references added to my project but I still get this error. What am I
    missing?
    Mel, Aug 10, 2007
    #1
    1. Advertising

  2. You need to install Excel on the server as well. Remember the interop
    libraries are just wrappers around the actual Excel COM library.

    BTW, automating Microsoft Office applications on server-side is not
    recommended and nor supported. For more info, read
    http://support.microsoft.com/kb/257757/

    "Mel" wrote:

    > Can anyone tell me why I am getting this error? It bombs on this line
    > of my VB code:
    > Public appExcel As New Excel.Application
    >
    > It works when I test it on my machine but once I release the page to
    > the web server I get the error when I click on a hyperlink that loads
    > the page. I have the Interop.Excel and Interop.Microsoft.Office.Core
    > references added to my project but I still get this error. What am I
    > missing?
    >
    >
    =?Utf-8?B?U2l2YSBN?=, Aug 10, 2007
    #2
    1. Advertising

  3. "Mel" <> wrote in message
    news:...

    > Can anyone tell me why I am getting this error? It bombs on this line
    > of my VB code:
    > Public appExcel As New Excel.Application


    Because server-side Office automation doesn't work:
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2

    You'll need to find a different method of integrating Excel into your
    ASP.NET app - what are you trying to do exactly...?


    --
    Mark Rae
    ASP.NET MVP
    http://www.markrae.net
    Mark Rae [MVP], Aug 10, 2007
    #3
  4. Mel

    Mel Guest

    On Aug 10, 11:45 am, "Mark Rae [MVP]" <> wrote:
    > "Mel" <> wrote in message
    >
    > news:...
    >
    > > Can anyone tell me why I am getting this error? It bombs on this line
    > > of my VB code:
    > > Public appExcel As New Excel.Application

    >
    > Because server-side Office automation doesn't work:http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2
    >
    > You'll need to find a different method of integrating Excel into your
    > ASP.NET app - what are you trying to do exactly...?
    >
    > --
    > Mark Rae
    > ASP.NET MVPhttp://www.markrae.net


    The Excel spreadsheet is a calculator. It has a ton of formulas which
    were written by a 3rd party vendor of ours. Instead of reinventing
    the wheel and creating a new web page which incorporates all of those
    same formulas I figured it was easier to just have Excel run in the
    background with that spreadsheet open (for read only access). The
    idea is, when the user changes an input field on the web page the
    visual basic code changes the corresponding field in the spreadsheet
    which is running in the background and just retrieves the results from
    the spreadsheet and places them on the web page "outputs" section.

    Then, as far as maintenance is concerned, if in the future any of the
    calculations change we can just update the spreadsheet and no code
    would need to be changed on the web site.
    Mel, Aug 10, 2007
    #4
  5. "Mel" <> wrote in message
    news:...

    > I figured it was easier to just have Excel run in the background


    Won't work, I'm afraid - Excel (like the rest of Office) just isn't designed
    to be run like this...


    --
    Mark Rae
    ASP.NET MVP
    http://www.markrae.net
    Mark Rae [MVP], Aug 10, 2007
    #5
  6. Mel

    Mel Guest

    On Aug 10, 12:16 pm, "Mark Rae [MVP]" <> wrote:
    > "Mel" <> wrote in message
    >
    > news:...
    >
    > > I figured it was easier to just have Excel run in the background

    >
    > Won't work, I'm afraid - Excel (like the rest of Office) just isn't designed
    > to be run like this...
    >
    > --
    > Mark Rae
    > ASP.NET MVPhttp://www.markrae.net


    Seriously. That stinks. So what are my alternatives?
    Mel, Aug 10, 2007
    #6
  7. Mel

    Mel Guest

    On Aug 10, 11:16 am, Siva M <> wrote:
    > You need to install Excel on the server as well. Remember the interop
    > libraries are just wrappers around the actual Excel COM library.
    >
    > BTW, automating Microsoft Office applications on server-side is not
    > recommended and nor supported. For more info, readhttp://support.microsoft.com/kb/257757/
    >
    > "Mel" wrote:
    > > Can anyone tell me why I am getting this error? It bombs on this line
    > > of my VB code:
    > > Public appExcel As New Excel.Application

    >
    > > It works when I test it on my machine but once I release the page to
    > > the web server I get the error when I click on a hyperlink that loads
    > > the page. I have the Interop.Excel and Interop.Microsoft.Office.Core
    > > references added to my project but I still get this error. What am I
    > > missing?


    Yep, we did install Excel on the web server. If it's not supported
    does that mean it absolutely can't be done? Is that the reason why I
    am getting the error message, because it's not supported?
    Mel, Aug 10, 2007
    #7
  8. "Mel" <> wrote in message
    news:...

    > If it's not supported does that mean it absolutely can't be done?


    Yes.

    > Is that the reason why I am getting the error message, because it's not
    > supported?


    The reason you're getting the error message is because it doesn't work,
    which is also the reason why it's not supported...


    --
    Mark Rae
    ASP.NET MVP
    http://www.markrae.net
    Mark Rae [MVP], Aug 10, 2007
    #8
  9. Mark Rae [MVP], Aug 10, 2007
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nuve
    Replies:
    0
    Views:
    1,977
  2. Nuve Nai
    Replies:
    0
    Views:
    880
    Nuve Nai
    Oct 23, 2003
  3. CJM
    Replies:
    7
    Views:
    1,842
    Steven Cheng[MSFT]
    Aug 13, 2004
  4. David Lozzi

    BC30002: Type 'EventArgs' is not defined

    David Lozzi, Dec 6, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    2,902
    David Lozzi
    Dec 6, 2004
  5. Andrew

    error BC30002: Type 'x' not defined

    Andrew, Apr 22, 2009, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    770
    Andrew
    Apr 22, 2009
Loading...

Share This Page