using System; using System.Collections.Generic; using System.Text; using Microsoft.Office.Interop.Excel; using System.IO; using System.Reflection; using System.Runtime.InteropServices; using Microsoft.Office.Core; namespace HustCAD.IntePLM.Win.BatchE
if (fileName == "") return ""; var CurrentRow = 0; Workbook work = new Workbook(fileName); var sheet = work.Worksheets[0]; string name = ""; if (sheet != null) { name = sheet.Name; //获取建设期 var cp = 10; var rowCount = sheet.Ce
Sub 将所有列全部转换为文本() t=timer 'Cells(Rows.Count, 1).End(xlUp).Row 获取第一列最后一个非空单元格的行号 s = Cells(, Columns.Count).End(xlToLeft).Column '获取第一行最后一个非空单元格的列号 For i = To s Columns(i).Select Selection.TextToColumns Destination:=Cells(, i), DataType:=xlDelimited,
Range[] rangeCells = sheet.getMergedCells();// 返回sheet中合并的单元格数组 for (Range r : rangeCells) {//对数组遍历拿到每个合并的单元格 Cell cellTop = r.getTopLeft();//获取某个合并的单元格的左上角的单元格 int beginRow= cellTop.getRow();//获取左上角单元格所在行 int beginColumn=cellTop.getColumn();//获取左上角单