用C#应用程序填充Excel文件 [英] Fill Excel file with c# application

查看:105
本文介绍了用C#应用程序填充Excel文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.我试图从C#中填充Excel文件超过一个月
我知道这里是经验丰富的人,可以给我一些有用的建议.
所以.... xls国际表单中有很多列行和文本.我想对可以在当前位置插入值的c#应用进行编程.例如在27,K中插入239 USD(这是excel表格单元格的地址)
有可能吗?
您有什么建议?
如果使用html或其他方法更简单?
我需要分步教程或书之类的东西
对我来说非常重要
谢谢

Hello everybody. I m trying to fill excel file from c# more than one month
I know here is experienced people who can give me some useful advices.
So... There is .xls international Form in it is lots of columns rows and texts. I want to program c# app which can insert values in current place. for example insert 239 USD in 27, K (this is a address of excel forms cell)
Does it possible?
What is your advice?
If it easier way to use html or something another?
i need step by step tutorials or book or something
It is very very important for me
Thanks

推荐答案

你好;有关使用C#winform的信息,可以检查该链接,您可以在其中填充excel工作表中的任何单元格,也可以填充空白工作表...
链接1 [ ^ ]

这是在excel表中设置范围的基本代码:

hello ; for using C# winform , you can check that link where you can fill any cell in excel sheet or fill a worksheet from blank ...
link1[^]

and here is a base code for assinging a range in excel sheet :

object optional = Missing.Value;
object updateLinks = 0;
Microsoft.Office.Interop.Excel._Workbook wkb = app.Workbooks.Open
(fullname, updateLinks, optional, optional, optional, optional,
optional, optional, optional, optional, optional, optional, optional,
optional, optional);
Microsoft.Office.Interop.Excel._Worksheet wks =
(_Worksheet)wkb.Worksheets.get_Item(MySheet.Text);
wks.Activate();
wks.Visible = XlSheetVisibility.xlSheetVisible;
Range wksRange;
wksRange = wks.get_Range("H7", "H7");
wksRange.set_Value(Missing.Value, workingDate);
app.Calculate();
wkb.Save();
wkb.Close(false,Missing.Value,false);
app.Quit();



这取决于您的excel工作表有多复杂...
希望能对您有帮助...
问候...

希望对您有帮助



it depends on how much is your excel sheet is complicated...
any way hope that will help you...
regards...

hope that will help you


这篇关于用C#应用程序填充Excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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