Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel and S sharp issue

Status
Not open for further replies.

piofenton

Instructor
Jul 12, 2002
33
IE
I'm trying to get Excel launched from inside a C-Sharp program. unfortunately I keep getting the following error when I try to debug. Why is it not accepting Excel as a legitimate class?


The type or namespace name 'Excel' could not be found (are you missing a using directive or an assembly reference?)


using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Text.RegularExpressions;
using Microsoft.Office.Core; //needed to work with excel
using Microsoft.Office.Interop;


private Excel.ApplicationClass app = null; // the Excel application.
 
Try

using Excel = Microsoft.Office.Interop.Excel;
...

Excel.Application excelApp = new Excel.Application();

~LFCfan
Who is relieved Friday has finally arrived

 
you're welcome! And I'm sure everyone understood what S Sharp means :)

~LFCfan
Who is relieved Friday has finally arrived

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top