如有下面的代码,请问其中的"a = App.WorksheetFunction.RoundUp(Len(ws.range(s1)), 0)
"
有什么问题吗?
该语句主要是想计算Exce单元格中的字数的,但在说明文件中找不到用VBA如何调用Excel函数的相关内容.
Dim Book As New XLS.Book(ProjectPath & "Attachments\销售订单.xls")
Book.Build()
Dim s As String = Tables("osal_ord1").Current("sheet_no")
s = s.Replace("/"," ")
Book.Save(ProjectPath & "Reports\销售订单\" & s & ".xls")
Dim App As New MSExcel.Application
App.Visible = True
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(ProjectPath & "Reports\销售订单\" & s & ".xls")
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
Dim range As MSExcel.Range
Dim lastrow As Long
Dim rng As Integer
lastrow = Ws.usedrange.rows.count-13
rng = ws.range(Ws.cells(11,1),Ws.cells(lastrow,1)).entirerow.autofit
Dim r As Long
r =lastrow-11
Dim s1 As String = "B" & r
Dim a As Integer
a = App.WorksheetFunction.RoundUp(Len(ws.range(s1)), 0)
If a > 0 Then
ws.range(s1).RowHeight = 409
End If
Wb.Save