16,554
社区成员
发帖
与我相关
我的任务
分享
Module Module1
Public exeDir As New IO.FileInfo(Reflection.Assembly.GetExecutingAssembly.FullName)
Public xlPath = IO.Path.Combine(exeDir.DirectoryName, "Database.xlsx")
Public xlApp As Microsoft.Office.Interop.Excel.Application = Nothing
Public xlBook As Microsoft.Office.Interop.Excel.Workbook
Public xlSheet1 As Microsoft.Office.Interop.Excel.Worksheet
Public xlSheet2 As Microsoft.Office.Interop.Excel.Worksheet
End Module
Public Class Heater
Sub Setup_Htr_DB()
'Output2
xlSheet1.Range("C136").Value2 = Output2.Checked.ToString
xlSheet1.Range("C137").Value2 = Output2.Checked.ToString
xlSheet2.Range("C36").Value2 = Output2.Checked.ToString
'Output3
xlSheet1.Range("C136").Value = Output3.Checked.ToString
xlSheet1.Range("C137").Value = Output3.Checked.ToString
xlSheet2.Range("C37").Value = Output3.Checked.ToString
End Sub
Private Sub PB_Preview_Click(sender As Object, e As EventArgs) Handles PB_Preview.Click
xlApp = New Microsoft.Office.Interop.Excel.Application With {
.DisplayAlerts = False,
.Visible = False
}
xlBook = xlApp.Workbooks.Open(xlPath)
xlSheet1 = xlBook.Sheets(1)
xlSheet2 = xlBook.Sheets(2)
Setup_Htr_DB()
End Sub
End Class