如下
Dim rcount As Integer = Tables("表A").BottomPosition - Tables("表A").TopPosition
Dim path As String
If rcount = 1 Then
path = "Attachments\出库单1.xls")
Else If rcount >= 2 AndAlso rcount <= 5 Then
path = "Attachments\出库单2.xls")
Else If roucnt >= 6 AndAlso rcount <= 10 Then
path = "Attachments\出库单3.xls")
Else
msgbox("超限制")
End If
If path > "" Then
Dim Book As New XLS.Book(ProjectPath & path)
Dim fl As String = ProjectPath & "Reports\出库单.xls"
Book.Build() '生成细节区
Book.Save(fl) '保存工作簿
Dim Proc As New Process '打开工作簿
Proc.File = fl
Proc.Start()
End If