Microsoft Office Excel cannot access the file (IIS7)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • abb

    #1

    Microsoft Office Excel cannot access the file (IIS7)

    On a Vista machine, the following code works using the ASP.NET
    Development Server, but fails in IIS7:

    book = excel.Workbooks .Open(tempfile,
    false, false, Missing.Value,
    Missing.Value, Missing.Value, Missing.Value,
    Missing.Value,

    In IIS7, the error is "Microsoft Office Excel cannot access the
    file ... There are several possible reasons:
    • The file name or path does not exist.
    • The file is being used by another program.
    • The workbook you are trying to save has the same name as a currently
    open workbook."


    Both NETWORK SERVICE and IUSR have:
    - read/write permissions on the temp folder
    - Launch, Access, and Configuration permissions in DCOM Config for
    Excel


    I've also tried running the IIS application as my local adminstrator
    account, but the same error occurs. It's IIS7 specific. What
    permission does it need? Any ideas? Thanks.
  • Mark Rae [MVP]

    #2
    Re: Microsoft Office Excel cannot access the file (IIS7)

    "abb" <andrewbb@gmail .comwrote in message
    news:343bef99-65fa-4cd5-9643-aac8c6bdc833@w1 g2000prk.google groups.com...
    Any ideas?
    Yes, but you're not going to like them...

    Server-side Office Automation is not recommended by Microsoft, nor is it
    supported, for the simple reason that it doesn't work properly.

    Microsoft Office simply wasn't designed to be run in this type of
    architecture. See the following KB articles:



    If you simply need to treat an Excel spreadsheet as a datasource, you can
    use ADO.NET just like with any other database.

    For any other usage, there is really only one solution which is guaranteed
    to work:



    --
    Mark Rae
    ASP.NET MVP


    Comment

    • Joern Schou-Rode

      #3
      Re: Microsoft Office Excel cannot access the file (IIS7)

      On Sun, 20 Jul 2008 10:08:28 +0200, Mark Rae [MVP]
      <mark@marknospa mrae.netwrote:
      For any other usage, there is really only one solution which is
      guaranteed to work:
      http://www.aspose.com/categories/fil...a/default.aspx
      If you do not need anything fancy, you might be able to do with this free,
      open-source library:


      If you do need the fancy stuff, Aspose is the way to go.

      --
      Joern Schou-Rode

      Comment

      • Mark Rae [MVP]

        #4
        Re: Microsoft Office Excel cannot access the file (IIS7)

        "Joern Schou-Rode" <jsr@malamute.d kwrote in message
        news:op.uelu6oy l31zpn8@marvin. ..
        If you do not need anything fancy, you might be able to do with this free,
        open-source library: http://myxls.in2bits.org/
        I've not seen that before - is it fairly new...?

        I do understand that Aspose is simply too expensive for some potential
        users, so this might be an excellent free alternative. Do you have any
        experience with it...?


        --
        Mark Rae
        ASP.NET MVP


        Comment

        • ZSvedic

          #5
          Re: Microsoft Office Excel cannot access the file (IIS7)

          On Jul 20, 8:07 am, abb <andre...@gmail .comwrote:
          On a Vista machine, the following code works using the ASP.NET
          Development Server, but fails in IIS7:
          >
          book =excel.Workbook s.Open(tempfile ,
                       false, false, Missing.Value,
                       Missing.Value, Missing.Value, Missing.Value,
          Missing.Value,
          >
          In IIS7, the error is "Microsoft OfficeExcelcann ot access the
          file ... There are several possible reasons:
          • The file name or path does not exist.
          • The file is being used by another program.
          • The workbook you are trying to save has the same name as a currently
          open workbook."
          >
          Both NETWORK SERVICE and IUSR have:
          - read/write permissions on the temp folder
          - Launch, Access, and Configuration permissions in DCOM Config forExcel
          >
          I've also tried running the IIS application as my local adminstrator
          account, but the same error occurs.  It's IIS7 specific.  What
          permission does it need?  Any ideas?  Thanks.
          I agree with Mark that there are many automation issues on the server:

          Except previously mentioned myxls and Aspose.Cells, you can try our
          free Excel R/W component: http://www.gemboxsoftware.com/GBSpreadsheetFree.htm
          If you have XLS/CSV/XLSX files smaller that 150 rows it is free of
          charge, otherwise it is $425 per developer (one time fee).
          --Zeljko

          Comment

          • =?Utf-8?B?VGltIEVyaWNrc29u?=

            #6
            Re: Microsoft Office Excel cannot access the file (IIS7)

            The latest release (from July 9 - 2 weeks ago) will also do basic read
            operations as well as write. It's not so new, but not getting any
            Google-juice. It's my project on SourceForge.

            "Mark Rae [MVP]" wrote:
            "Joern Schou-Rode" <jsr@malamute.d kwrote in message
            news:op.uelu6oy l31zpn8@marvin. ..
            you might be able to do with this free,
            open-source library: http://myxls.in2bits.org/
            >
            I've not seen that before - is it fairly new...?
            >
            I do understand that Aspose is simply too expensive for some potential
            users, so this might be an excellent free alternative. Do you have any
            experience with it...?
            >
            >
            --
            Mark Rae
            ASP.NET MVP

            >
            >

            Comment

            Working...