Hi, my first programming query: well three queries. All I hope are trivial :)
I thought I would have a go at trying to retrieve a value from an existing excel sheet.
To do this I have used Project...Add reference to add
- Microsoft Excel 12.0 Object library
- Microsoft Excel 5.0 Object Library
Which one should I use?
This has given me in the project References:
- Excel
- Microsoft.Office.Core
- Microsoft.Office.Interop.Excel
Looking at Excel and ...Interop.Excel they seem to be fairly similar. What is the difference and which one should I use?
I have put in my programme
using Excel;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Excel.Application xl = new Excel._ExcelApplicationClass();
On the line ...= new... I get the error:Error 1 Cannot implicitly convert type 'Excel._ExcelApplicationClass' to 'Excel.Application'. An explicit conversion exists (are you missing a cast?)
What am I doing wrong?