Dim App As New MSExcel.Application Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open("C:\交期明细表.xls") Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1) Dim Rg As MSExcel.Range = Ws.UsedRange For i As Integer = 1 To rg.Rows.count If ws.Cells(i, 21).Text = Nothing Then ws.Cells(i, 21).value = 1 ws.Cells(i,21).NumberFormat= "yyyy-m-d" End If Next App.Visible = True