Manipulating Excel in

'  creat a Application object        
    oXL = New ApplicationClass()

Hi I am getting an error with the code above. Do I need to add a reference to my project?
Error      1      Interop type 'ApplicationClass' cannot be embedded. Use the applicable interface instead.      C:\Users\User\Documents\Visual Studio 2010\Projects\Excel1\Excel1\Default.aspx.vb      26      19      Excel1
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You're meant to use Application rather than ApplicationClass.

However, check to ake sure that you have a reference to: Microsoft.Office.Interop.Excel in your project

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Carlos VillegasFull Stack .NET DeveloperCommented:
Did you tried?
Dim app As New Microsoft.Office.Interop.Excel.Application

Open in new window

What Excel references are you using? may be "Microsoft Excel 12.0 Object Library"?
You need to declare the variable as Microsoft.Office.Interop.Excel.Application, but instantiate it as Microsoft.Office.Interop.Excel.ApplicationClass.

Dim app As Microsoft.Office.Interop.Excel.Application = New Microsoft.Office.Interop.Excel.ApplicationClass

Open in new window

Carlos VillegasFull Stack .NET DeveloperCommented:
Another tip, If you plan to manipulate Excel files, I recommend you to use OleDb (Microsoft Jet 4.0), it have better performance but it's more limited.
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.