C#中如何调用Microsoft.Office.Interop.Excel.ApplicationClass类中的Fv函数? 在线等!!!!
1个回答
2016-07-29
展开全部
写入Excel内容,参数:excelTable是要导入excel的一个table表
public static bool SaveDataTableToExcel(System.Data.DataTable excelTable, string filePath)
{
Microsoft.Office.Interop.Excel.Application app =
new Microsoft.Office.Interop.Excel.ApplicationClass();
try
{
app.Visible = false;
Workbook wBook = app.Workbooks.Add(true);
Worksheet wSheet = wBook.Worksheets[1] as Worksheet;
if (excelTable.Rows.Count > 0)
{
int row = 0;
public static bool SaveDataTableToExcel(System.Data.DataTable excelTable, string filePath)
{
Microsoft.Office.Interop.Excel.Application app =
new Microsoft.Office.Interop.Excel.ApplicationClass();
try
{
app.Visible = false;
Workbook wBook = app.Workbooks.Add(true);
Worksheet wSheet = wBook.Worksheets[1] as Worksheet;
if (excelTable.Rows.Count > 0)
{
int row = 0;
追问
我找到了办法,应该是
Microsoft.Office.Interop.Excel.ApplicationClass excel =new Microsoft.Office.Interop.Excel.ApplicationClass();
excel.WorksheetFunction.Fv(,,,,,);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询