user1334858
user1334858

Reputation: 1935

Create .Net Excel::Application in c++/cli

I want to create an excel file inside of my C++ project, I would use C# but because of other restraints I have to use C++.

When I go to create a new application like this:

#define excel Microsoft::Office::Interop::Excel
excel::Application^ exlFile = gcnew excel::Application;

it underlines excel::Application in red and say:

Cannot create an object of a CLI interface class

Am I doing something wrong, or is there no way to create a full application inside of C++/cli? If I am doing something wrong will you please let me know? If you need more information please let me know.

Using VS 2012

#using <Microsoft.Office.Interop.Excel.dll>

Upvotes: 0

Views: 1900

Answers (1)

Ben Voigt
Ben Voigt

Reputation: 283713

Try using Excel::Application^ xl = gcnew Excel::ApplicationClass() instead.

Upvotes: 1

Related Questions