Dim blStockMaterials(1) As Boolean
Dim strFileName(1) As String, str As String
Dim strSheetName(1) As String
Dim i As Integer
blStockMaterials(0) = e.Form.Controls("chkElectric").checked
blStockMaterials(1) = e.Form.Controls("chkTeleComm").checked
strFileName(0) = e.Form.Controls("txtElectricDrawingsList").text
strFileName(1) = e.Form.Controls("txtTeleCommDrawingsList").text
strSheetName(0) = e.Form.Controls("lstElectricSheet").SelectedValue
strSheetName(1) = e.Form.Controls("lstTelecommSheet").SelectedValue
For i = LBound(strFileName) To UBound(strFileName)
If blStockMaterials(i) Then
If FileSys.FileExists(strFileName(i)) Then
Dim Book As New XLS.Book(strFileName(i)) '定义一个Excel工作簿
Dim Sheet As XLS.Sheet = Book.Sheets(strSheetName(i)) '引用工作表