• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 573
  • Last Modified:

Manipulating Excel in ASP.net

'  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 ASP.net 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
0
Murray Brown
Asked:
Murray Brown
  • 2
  • 2
1 Solution
 
MlandaTCommented:
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
0
 
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"?
0
 
MlandaTCommented:
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

0
 
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.
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now