Microsoft.Office.Interop.Excel.Application when i debug its not given error when i Releas its given error are you missing assembly

Hiteshkumar Patel 21 Reputation points

hello everyone,
i am trying to Release my Windows base application for automatic update get my application users but its given me an error for
Severity Code Description Project File Line Suppression State
Error CS0234 The type or namespace name 'Excel' does not exist in the namespace 'Microsoft.Office.Interop' (are you missing an assembly reference?) ERPs

when i select Debug mode its not given any error

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
9,015 questions
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,319 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: The period of time during which a program is being executed in a computer.
1,044 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Karen Payne MVP 32,991 Reputation points

    Generally when Excel code works in debug mode or release mode on a developer's box then fails on a client's box means either the client does not have Excel installed or does not have the correct version of Excel.

    The best solution is not to use Excel automation, instead use an Excel library which is not dependent on Excel being installed. Two of many free libraries

    And there are plenty of paid for libraries such as

    And there is always the option to skip libraries and code what those libraries do yourself

    0 comments No comments