?
Solved

Looking for .NET Excel Class

Posted on 2011-04-30
5
Medium Priority
?
197 Views
Last Modified: 2012-05-11
In the following article, Senthil S. uses the following code:

Article: http://www.codeproject.com/KB/vb/Senthil_S__Software_Eng_.aspx

Code:
    With Excel
            .SheetsInNewWorkbook = 1
            .Workbooks.Add()
            .Worksheets(1).Select()
           ...

Open in new window

Unfortunately, he doesn't include a Dim statement for the Excel object.  My best guess is this:
        Dim Excel As Microsoft.Office.Interop.Excel.Workbook

Open in new window

Am I wrong?  Am I right?
0
Comment
Question by:jdana
5 Comments
 
LVL 21

Accepted Solution

by:
Alfred A. earned 800 total points
ID: 35496882
If you are using Microsoft Excel 12.0 Object Library this should be

Dim Excel As Microsoft.Office.Interop.Excel.Application



0
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 35496887
Should be :
Microsoft.Office.Interop.Excel.ApplicationClass
0
 
LVL 12

Expert Comment

by:mwochnick
ID: 35496899
He has this line earlier in the article
Dim excel As New Microsoft.Office.Interop.Excel.ApplicationClass

Open in new window

0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 200 total points
ID: 35497015
Make sure you have installed the correct Office Primary Interop Assemblies and referenced the excel DLL in your project.
0
 

Author Closing Comment

by:jdana
ID: 35501086
Alfred nailed it.  (I'm running VS 2010 and "Embed Interop Types" set to TRUE.)

Thanks all.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month16 days, 20 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question