Link to home
Start Free TrialLog in
Avatar of jdana
jdanaFlag for United States of America

asked on

Looking for .NET Excel Class

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?
ASKER CERTIFIED SOLUTION
Avatar of Alfred A.
Alfred A.
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Paul Jackson
Should be :
Microsoft.Office.Interop.Excel.ApplicationClass
He has this line earlier in the article
Dim excel As New Microsoft.Office.Interop.Excel.ApplicationClass

Open in new window

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jdana

ASKER

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

Thanks all.