Murray Brown
asked on
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\Vi sual Studio 2010\Projects\Excel1\Excel 1\Default. aspx.vb 26 19 Excel1
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\Vi
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You need to declare the variable as Microsoft.Office.Interop.E xcel.Appli cation, but instantiate it as Microsoft.Office.Interop.E xcel.Appli cationClas s.
Dim app As Microsoft.Office.Interop.Excel.Application = New Microsoft.Office.Interop.Excel.ApplicationClass
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.
ASKER
thanks
Open in new window
What Excel references are you using? may be "Microsoft Excel 12.0 Object Library"?