zoukankan      html  css  js  c++  java
  • Excel数据的简单显示在ListBox上

    显示第一列的数据!本人水平一般,有错就当参考!  

                 Excel.Application xApp = new Excel.Application();
                xApp.Visible = false;
                Excel.Workbook xBook = xApp.Workbooks._Open(@"D: est.xls",
                Missing.Value, Missing.Value, Missing.Value, Missing.Value
                , Missing.Value, Missing.Value, Missing.Value, Missing.Value
                , Missing.Value, Missing.Value, Missing.Value, Missing.Value);
                Excel.Worksheet xSheet = (Excel.Worksheet)xBook.Sheets[1];

                for (int row = 1; row < 4; ++row)
                {
                        Excel.Range rng2 = (Excel.Range)xSheet.Cells[row, 1];
                       lineListBox.Items.Add(Convert.ToString(rng2.Value.ToString()));   
                }

               xApp.Quit();

  • 相关阅读:
    自然拼读
    windws蓝屏解决方案
    chrome
    ubuntu安装英伟达驱动
    ubuntu基础
    kvm(未完成2021-04-26)
    istio
    OpenSSH
    su 与 su -关系
    read命令/ declare/set
  • 原文地址:https://www.cnblogs.com/shadow-fei/p/3303364.html
Copyright © 2011-2022 走看看