EXCEL TOOLS
Excel Add-ins ที่พัฒนาโดยคุณสันติพงศ์ ณสุย (MVP Excel 2010-2020) ด้วยภาษา C# เพื่อแก้ไขปัญหาไฟล์ใหญ่ คำนวณนาน ทำงานช้า จัดการข้อมูลต่าง ๆ ที่ทำงานประจำวันได้อย่างสะดวกรวดเร็ว สนใจคลิกไปดูได้ที่นี่ครับ => Excel Tools
Excel Add-ins ที่พัฒนาโดยคุณสันติพงศ์ ณสุย (MVP Excel 2010-2020) ด้วยภาษา C# เพื่อแก้ไขปัญหาไฟล์ใหญ่ คำนวณนาน ทำงานช้า จัดการข้อมูลต่าง ๆ ที่ทำงานประจำวันได้อย่างสะดวกรวดเร็ว สนใจคลิกไปดูได้ที่นี่ครับ => Excel Tools
[code]
และปิดด้วย [/code]
ตัวอย่างเช่น [code]dim r as range[/code]
เพื่อให้แตกต่างจากข้อความทั่วไป สะดวกในการอ่านและทดสอบ (คลิกเพื่อดูตัวอย่างเพิ่มเติม)Code: Select all
Public Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
' Timerstart
Timer1.Start()
Timer2.Start()
MessageBox.Show("Start program...", "WiFiLogtech Message:...")
' Readtextfile Temp.Calibration_Rm
Try
Dim F As StreamReader = New System.IO.StreamReader("C:\Scrip\Floor2\Calibration_Rm.txt")
Row = Split(F.ReadToEnd, vbNewLine)
F.Close()
CL = Row(0).Split(",")
FN = CL(1)
CL = Row(1).Split(",")
Location1 = CL(1)
CL = Row(2).Split(",")
Maxt = CL(1)
CL = Row(3).Split(",")
Mint = CL(1)
CL = Row(4).Split(",")
Maxh = CL(1)
CL = Row(5).Split(",")
Minh = CL(1)
CL = Row(6).Split(",")
Series = CL(1)
CL = Row(7).Split(",")
Duedate = CL(1)
' Readtextfile Lubricant3_Rm
Dim F2 As StreamReader = New System.IO.StreamReader("C:\Scrip\Floor2\Lubricant3_Rm.txt")
Row2 = Split(F2.ReadToEnd, vbNewLine)
F2.Close()
CL2 = Row2(0).Split(",")
FN2 = CL2(1)
CL2 = Row2(1).Split(",")
Location2 = CL2(1)
CL2 = Row2(2).Split(",")
Maxt2 = CL2(1)
CL2 = Row2(3).Split(",")
Mint2 = CL2(1)
CL2 = Row2(4).Split(",")
Maxh2 = CL2(1)
CL2 = Row2(5).Split(",")
Minh2 = CL2(1)
CL2 = Row2(6).Split(",")
Series2 = CL2(1)
CL2 = Row2(7).Split(",")
Duedate2 = CL2(1)
' Readtextfile Lubricant2_Rm
Dim F3 As StreamReader = New System.IO.StreamReader("C:\Scrip\Floor2\Lubricant2_Rm.txt")
Row3 = Split(F3.ReadToEnd, vbNewLine)
F3.Close()
CL3 = Row3(0).Split(",")
FN3 = CL3(1)
CL3 = Row3(1).Split(",")
Location3 = CL3(1)
CL3 = Row3(2).Split(",")
Maxt3 = CL3(1)
CL3 = Row3(3).Split(",")
Mint3 = CL3(1)
CL3 = Row3(4).Split(",")
Maxh3 = CL3(1)
CL3 = Row3(5).Split(",")
Minh3 = CL3(1)
CL3 = Row3(6).Split(",")
Series3 = CL3(1)
CL3 = Row3(7).Split(",")
Duedate3 = CL3(1)
' Readtextfile Lubricant1_Rm
Dim F4 As StreamReader = New System.IO.StreamReader("C:\Scrip\Floor2\Lubricant1_Rm.txt")
Row4 = Split(F4.ReadToEnd, vbNewLine)
F4.Close()
CL4 = Row4(0).Split(",")
FN4 = CL4(1)
CL4 = Row4(1).Split(",")
Location4 = CL4(1)
CL4 = Row4(2).Split(",")
Maxt4 = CL4(1)
CL4 = Row(3).Split(",")
Mint4 = CL4(1)
CL4 = Row4(4).Split(",")
Maxh4 = CL4(1)
CL4 = Row4(5).Split(",")
Minh4 = CL4(1)
CL4 = Row4(6).Split(",")
Series4 = CL4(1)
CL4 = Row4(7).Split(",")
Duedate4 = CL4(1)
' Readtextfile ICP_Rm
Dim F5 As StreamReader = New System.IO.StreamReader("C:\Scrip\Floor1\ICP_Rm.txt")
Row5 = Split(F5.ReadToEnd, vbNewLine)
F5.Close()
CL5 = Row5(0).Split(",")
FN5 = CL5(1)
CL5 = Row5(1).Split(",")
Location5 = CL5(1)
CL5 = Row5(2).Split(",")
Maxt5 = CL5(1)
CL5 = Row5(3).Split(",")
Mint5 = CL5(1)
CL5 = Row5(4).Split(",")
Maxh5 = CL5(1)
CL5 = Row5(5).Split(",")
Minh5 = CL5(1)
CL5 = Row5(6).Split(",")
Series5 = CL5(1)
CL5 = Row5(7).Split(",")
Duedate5 = CL(1)
' Readtextfile GC_Rm
Dim F6 As StreamReader = New System.IO.StreamReader("C:\Scrip\Floor1\GC_Rm.txt")
Row6 = Split(F6.ReadToEnd, vbNewLine)
F6.Close()
CL6 = Row6(0).Split(",")
FN6 = CL6(1)
CL6 = Row6(1).Split(",")
Location6 = CL6(1)
CL6 = Row6(2).Split(",")
Maxt6 = CL6(1)
CL6 = Row6(3).Split(",")
Mint6 = CL6(1)
CL6 = Row6(4).Split(",")
Maxh6 = CL6(1)
CL6 = Row6(5).Split(",")
Minh6 = CL6(1)
CL6 = Row6(6).Split(",")
Series6 = CL6(1)
CL6 = Row6(7).Split(",")
Duedate6 = CL6(1)
' Readtextfile Sulfer_Rm
Dim F7 As StreamReader = New System.IO.StreamReader("C:\Scrip\Floor1\Sulfer_Rm.txt")
Row7 = Split(F7.ReadToEnd, vbNewLine)
F7.Close()
CL7 = Row7(0).Split(",")
FN7 = CL7(1)
CL7 = Row7(1).Split(",")
Location7 = CL7(1)
CL7 = Row7(2).Split(",")
Maxt7 = CL7(1)
CL7 = Row7(3).Split(",")
Mint7 = CL7(1)
CL7 = Row7(4).Split(",")
Maxh7 = CL7(1)
CL7 = Row7(5).Split(",")
Minh7 = CL7(1)
CL7 = Row7(6).Split(",")
Series7 = CL7(1)
CL7 = Row7(7).Split(",")
Duedate7 = CL7(1)
' Readtextfile Flashpoint_Rm
Dim F8 As StreamReader = New System.IO.StreamReader("C:\Scrip\Floor1\Flashpoint_Rm.txt")
Row8 = Split(F8.ReadToEnd, vbNewLine)
F8.Close()
CL8 = Row8(0).Split(",")
FN8 = CL8(1)
CL8 = Row8(1).Split(",")
Location8 = CL8(1)
CL8 = Row8(2).Split(",")
Maxt8 = CL8(1)
CL8 = Row8(3).Split(",")
Mint8 = CL8(1)
CL8 = Row8(4).Split(",")
Maxh8 = CL8(1)
CL8 = Row8(5).Split(",")
Minh8 = CL8(1)
CL8 = Row8(6).Split(",")
Series8 = CL8(1)
CL8 = Row8(7).Split(",")
Duedate8 = CL8(1)
' Readtextfile Wast_Water_Rm
Dim F9 As StreamReader = New System.IO.StreamReader("C:\Scrip\Floor3\Wast_Water_Rm.txt")
Row9 = Split(F9.ReadToEnd, vbNewLine)
F9.Close()
CL9 = Row9(0).Split(",")
FN9 = CL9(1)
CL9 = Row9(1).Split(",")
Location9 = CL9(1)
CL9 = Row9(2).Split(",")
Maxt9 = CL9(1)
CL9 = Row9(3).Split(",")
Mint9 = CL9(1)
CL9 = Row9(4).Split(",")
Maxh9 = CL9(1)
CL9 = Row9(5).Split(",")
Minh9 = CL9(1)
CL9 = Row9(6).Split(",")
Series9 = CL9(1)
CL9 = Row9(7).Split(",")
Duedate9 = CL9(1)
' Readtextfile Fuel_Rm
Dim F10 As StreamReader = New System.IO.StreamReader("C:\Scrip\Floor3\Fuel_Rm.txt")
Row10 = Split(F10.ReadToEnd, vbNewLine)
F10.Close()
CL10 = Row10(0).Split(",")
FN10 = CL10(1)
CL10 = Row10(1).Split(",")
Location10 = CL10(1)
CL10 = Row10(2).Split(",")
Maxt10 = CL10(1)
CL10 = Row10(3).Split(",")
Mint10 = CL10(1)
CL10 = Row10(4).Split(",")
Maxh10 = CL10(1)
CL10 = Row10(5).Split(",")
Minh10 = CL10(1)
CL10 = Row10(6).Split(",")
Series10 = CL10(1)
CL10 = Row10(7).Split(",")
Duedate10 = CL10(1)
' Readtextfile 305_Rm
Dim F11 As StreamReader = New System.IO.StreamReader("C:\Scrip\Floor3\309_Rm.txt")
Row11 = Split(F11.ReadToEnd, vbNewLine)
F11.Close()
CL11 = Row11(0).Split(",")
FN11 = CL11(1)
CL11 = Row11(1).Split(",")
Location11 = CL11(1)
CL11 = Row11(2).Split(",")
Maxt11 = CL11(1)
CL11 = Row11(3).Split(",")
Mint11 = CL11(1)
CL11 = Row11(4).Split(",")
Maxh11 = CL11(1)
CL11 = Row11(5).Split(",")
Minh11 = CL11(1)
CL11 = Row11(6).Split(",")
Series11 = CL11(1)
CL11 = Row11(7).Split(",")
Duedate11 = CL11(1)
' Readtextfile 308_Rm
Dim F12 As StreamReader = New System.IO.StreamReader("C:\Scrip\Floor3\308_Rm.txt")
Row12 = Split(F12.ReadToEnd, vbNewLine)
F12.Close()
CL12 = Row12(0).Split(",")
FN12 = CL12(1)
CL12 = Row12(1).Split(",")
Location12 = CL12(1)
CL12 = Row12(2).Split(",")
Maxt12 = CL12(1)
CL12 = Row12(3).Split(",")
Mint12 = CL12(1)
CL12 = Row12(4).Split(",")
Maxh12 = CL12(1)
CL12 = Row12(5).Split(",")
Minh12 = CL12(1)
CL12 = Row12(6).Split(",")
Series12 = CL12(1)
CL12 = Row12(7).Split(",")
Duedate12 = CL12(1)
' Readtextfile FT-IR_Rm
Dim F13 As StreamReader = New System.IO.StreamReader("C:\Scrip\Floor3\FT-IR_Rm.txt")
Row13 = Split(F13.ReadToEnd, vbNewLine)
F13.Close()
CL13 = Row13(0).Split(",")
FN13 = CL13(1)
CL13 = Row13(1).Split(",")
Location13 = CL13(1)
CL13 = Row13(2).Split(",")
Maxt13 = CL13(1)
CL13 = Row13(3).Split(",")
Mint13 = CL13(1)
CL13 = Row13(4).Split(",")
Maxh13 = CL13(1)
CL13 = Row13(5).Split(",")
Minh13 = CL13(1)
CL13 = Row13(6).Split(",")
Series13 = CL13(1)
CL13 = Row13(7).Split(",")
Duedate13 = CL13(1)
Catch ex As Exception
End Try
Dim thread = New Thread(New System.Threading.ThreadStart(AddressOf Me.Hosting_port))
thread.Start()
NotifyIcon1.BalloonTipText = "Program Is running : Please wait..."
NotifyIcon1.Text = "Moniterparametor Application"
NotifyIcon1.ShowBalloonTip(5000)
CreateContextMenu()
Try
Dim result As Integer = DateTime.Compare(txtDueDate, Duedate)
If result >= 0 Then
Dim a As String = "Please Cal. " & Series & " on " & Location1 & " before " & Duedate & ""
ListBox1.Items.Add(a)
End If
Dim result2 As Integer = DateTime.Compare(txtDueDate, Duedate2)
If result2 >= 0 Then
Dim b As String = "Please Cal. " & Series2 & " on " & Location2 & " before " & Duedate2 & ""
ListBox1.Items.Add(b)
End If
Dim result3 As Integer = DateTime.Compare(txtDueDate, Duedate3)
If result3 >= 0 Then
Dim c As String = "Please Cal. " & Series3 & " on " & Location3 & " before " & Duedate3 & ""
ListBox1.Items.Add(c)
End If
Dim result4 As Integer = DateTime.Compare(txtDueDate, Duedate4)
If result4 >= 0 Then
Dim d As String = "Please Cal. " & Series4 & " on " & Location4 & " before " & Duedate4 & ""
ListBox1.Items.Add(d)
End If
Dim result5 As Integer = DateTime.Compare(txtDueDate, Duedate5)
If result5 >= 0 Then
Dim ff As String = "Please Cal. " & Series5 & " on " & Location5 & " before " & Duedate5 & ""
ListBox1.Items.Add(ff)
End If
Dim result6 As Integer = DateTime.Compare(txtDueDate, Duedate6)
If result6 >= 0 Then
Dim g As String = "Please Cal. " & Series6 & " on " & Location6 & " before " & Duedate6 & ""
ListBox1.Items.Add(g)
End If
Dim result7 As Integer = DateTime.Compare(txtDueDate, Duedate7)
If result7 >= 0 Then
Dim h As String = "Please Cal. " & Series7 & " on " & Location7 & " before " & Duedate7 & ""
ListBox1.Items.Add(h)
End If
Dim result8 As Integer = DateTime.Compare(txtDueDate, Duedate8)
If result8 >= 0 Then
Dim i As String = "Please Cal. " & Series8 & " on " & Location8 & " before " & Duedate8 & ""
ListBox1.Items.Add(i)
End If
Dim result9 As Integer = DateTime.Compare(txtDueDate, Duedate9)
If result9 >= 0 Then
Dim j As String = "Please Cal. " & Series9 & " on " & Location9 & " before " & Duedate9 & ""
ListBox1.Items.Add(j)
End If
Dim result10 As Integer = DateTime.Compare(txtDueDate, Duedate10)
If result10 >= 0 Then
Dim k As String = "Please Cal. " & Series10 & " on " & Location10 & " before " & Duedate10 & ""
ListBox1.Items.Add(k)
End If
Dim result11 As Integer = DateTime.Compare(txtDueDate, Duedate11)
If result11 >= 0 Then
Dim l As String = "Please Cal. " & Series11 & " on " & Location11 & " before " & Duedate11 & ""
ListBox1.Items.Add(l)
End If
Dim result12 As Integer = DateTime.Compare(txtDueDate, Duedate12)
If result12 >= 0 Then
Dim m As String = "Please Cal. " & Series12 & " on " & Location12 & " before " & Duedate12 & ""
ListBox1.Items.Add(m)
End If
Dim result13 As Integer = DateTime.Compare(txtDueDate, Duedate13)
If result13 >= 0 Then
Dim n As String = "Please Cal. " & Series13 & " on " & Location13 & " before " & Duedate13 & ""
ListBox1.Items.Add(n)
End If
Catch ex As Exception
End Try
End Sub