如何创建Excel文件...? [英] How to create a Excel File...?

查看:94
本文介绍了如何创建Excel文件...?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个可以将数据读/写到excel文件的应用程序.
会很好用的.

现在我想向我的应用程序添加一项功能,

1)那时我的应用程序启动时,我想检查excel文件是否存在.
2)如果它不存在,那么我想创建一个名称为contact.xls
的excel文件 使用worksheet1名称作为联系人.
3)并希望向该工作表添加一些联系人并将其保存到应用程序目录中

还有一件事如何从c#中获取运行目录信息的应用程序

请帮助我...

I have a application that will read/write data to excel file.
it will work fine.

now i want to add one functionality to my application,

1) when my application is started at that time i want to check that the excel file is exist or not.
2) if it is not existed then i want to create a excel file with the name contact.xls
with worksheet1 name as contacts.
3) and want to add some contact to that sheet and save it to the application directory

one thing more how to get the application running directory information from c#

please help me...

推荐答案

按照逐步的文章来创建excel文件,就可以了.

http://www.c-sharpcorner.com/UploadFile/jayendra/5443/ [ ^ ]



要获取根目录,请按照msdn上的这篇文章进行操作.

http://msdn.microsoft.com/en-us/library/aa457089.aspx [ ^ ]


如果解决您的问题,请标记为答案.
Follow step by step article to create excel file, and you are done.

http://www.c-sharpcorner.com/UploadFile/jayendra/5443/[^]



to get the root directory follow this article on msdn.

http://msdn.microsoft.com/en-us/library/aa457089.aspx[^]


mark as answer if solves you problem.


这篇关于如何创建Excel文件...?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆