how can i create an excel file using Interop on c+

2019-08-02 22:25发布

I've searched a lot of info, about the easiest way to create and edit excel files to save some login and passwords of my program. I've seen lots of C# methods and I don't understand it a lot.

I've added a reference to Visual Studio 2010 Microsoft.Office.Interop.Excel (I'm using Office 2010).

I don't know how to take this further, however; what headers should I add, what else should I do? I can't find any tutorial of C++ using this on their projects. I just want something simple.

EDIT:

I will run my program on a pc that has Office 2010 installed.

2条回答
手持菜刀,她持情操
2楼-- · 2019-08-02 22:45

Does the system where your application will run on have Excel installed or not?

If it does, you can use indeed use Excel as a COM component. http://www.wilmott.com/messageview.cfm?catid=10&threadid=26137 contains an example on how to do this.

If your system does not have Excel installed, you need to use a 3rd party library to create the Excel files for you. Just Google for "create excel files without excel" and you will find dozens of example code.

查看更多
登录 后发表回答