Looking for .NET Excel Class

Posted on 2011-04-30
Medium Priority
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

    With Excel
            .SheetsInNewWorkbook = 1

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?
Question by:jdana
LVL 21

Accepted Solution

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

LVL 29

Expert Comment

by:Paul Jackson
ID: 35496887
Should be :
LVL 12

Expert Comment

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

Open in new window

LVL 83

Assisted Solution

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.

Author Closing Comment

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

Thanks all.

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