【正文】
(1).Cells(present, ) 39。檢定結(jié)果 If 0 Then sheet(2).Cells(11, 2) = sheet(1).Cells(present, ) 39。檢定日期 If 0 Then sheet(2).Cells(12, 3) = sheet(1).Cells(present, ) 39。有效期至 End IfEnd SubPrivate Sub Command8_Click() 39。從當(dāng)錢頁打印 If Dir(C:\) = Then MsgBox !^^請打開要打印的表格^^! Else = present = True End IfEnd SubPrivate Sub Form_Load() present = 0 = = FalseEnd SubPrivate Sub Timer1_Timer()Dim a$ = False a = sheet(1).Cells(, 2) 39。如果單位名稱為“”則打印結(jié)束 If a Then If 0 Then sheet(2).Cells(1, 2) = sheet(1).Cells(, ) 39。單位名稱 If 0 Then sheet(2).Cells(2, 2) = sheet(1).Cells(, ) 39。產(chǎn)品名稱 If 0 Then sheet(2).Cells(3, 3) = sheet(1).Cells(, ) 39。設(shè)備編號 If 0 Then sheet(2).Cells(4, 2) = sheet(1).Cells(, ) 39。 設(shè)備廠址 If 0 Then sheet(2).Cells(5, 2) = sheet(1).Cells(, ) 39。設(shè)備型號 If 0 Then sheet(2).Cells(6, 2) = sheet(1).Cells(, ) 39。分度號 If 0 Then sheet(2).Cells(7, 2) = sheet(1).Cells(, ) 39。檢定結(jié)果 If 0 Then sheet(2).Cells(11, 2) = sheet(1).Cells(, ) 39。檢定日期 If 0 Then sheet(2).Cells(12, 3) = sheet(1).Cells(, ) 39。有效期至 39。打印輸出 = + 1 = = True Else MsgBox !^^表格已打完^^! amp。 Chr(10) amp。 !^^共打印 amp。 present 1 amp。 張^^! End IfEnd Sub運行VB程序,輸入?yún)?shù)點擊確定按鈕可完成參數(shù)的修改,打印時間是控制每打一張表所須時間,打開EXCEL系統(tǒng)后,VB程序和EXCEL分別屬兩個不同的應(yīng)用系統(tǒng),均可同時進行操作,由于系統(tǒng)加了判斷,因此在VB程序中重復(fù)點擊EXCEL按鈕時會提示EXCEL已打開。如果在EXCEL中關(guān)閉EXCEL后再點EXCEL按鈕,則會重新打開EXCEL。而無論EXCEL打開與否,通過VB程序均可關(guān)閉EXCEL。這樣就實現(xiàn)了VB與EXCEL的無縫連接。