설명 없음
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

採購單歷史檔案.vb 102KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093
  1. Option Strict Off
  2. Imports System.IO
  3. Imports Microsoft.Office.Interop.Excel.XlUnderlineStyle
  4. Imports Microsoft.Office.Interop.Excel.Constants
  5. Imports Microsoft.Office.Interop.Excel.XlBordersIndex
  6. Imports Microsoft.Office.Interop.Excel.XlLineStyle
  7. Imports Microsoft.Office.Interop.Excel.XlBorderWeight
  8. Imports Microsoft.Office.Interop.Excel.XlThemeFont
  9. Imports Microsoft.Office.Interop.Excel.XlThemeColor
  10. Imports Microsoft.Office.Interop.Excel.XlWindowState
  11. Imports Microsoft.Office.Interop.Excel
  12. Public Class 採購單歷史檔案
  13. ReadOnly ds8 As New DataSet : Dim xlApp As Application : Dim xlBook As Workbook : Dim xlSheet As Worksheet
  14. Dim N1, N2 As Integer : Dim 新項次 As String : Dim NUM1 As Integer : Private ReadOnly 對話框(7) As String : Dim 物料規格 As String
  15. 'ReadOnly QRCODE As DotNetBarcode = New DotNetBarcode
  16. Private Sub Set_清單()
  17. Dim ds As New DataSet : 明細_dgv.DataSource = Nothing : ds.Clear()
  18. 明細_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  19. 明細_dgv.ColumnHeadersHeight = 25
  20. 明細_dgv.AllowUserToAddRows = False
  21. If 小間距1_ch.Checked = False And 中間距1_ch.Checked = False And 大間距1_ch.Checked = True Then : 明細_dgv.RowTemplate.Height = 75
  22. ElseIf 小間距1_ch.Checked = False And 中間距1_ch.Checked = True And 大間距1_ch.Checked = False Then : 明細_dgv.RowTemplate.Height = 45
  23. ElseIf 小間距1_ch.Checked = True And 中間距1_ch.Checked = False And 大間距1_ch.Checked = False Then : 明細_dgv.RowTemplate.Height = 25 : End If
  24. SQL_建築物料採購單一覽表_明細()
  25. da.Fill(ds) : 明細_dgv.DataSource = ds.Tables(0) : conn.Close()
  26. 明細_dgv.Columns(0).Visible = False : 明細_dgv.Columns(1).FillWeight = 80 : 明細_dgv.Columns(2).FillWeight = 80 : 明細_dgv.Columns(3).FillWeight = 250
  27. 明細_dgv.Columns(4).FillWeight = 245 : 明細_dgv.Columns(5).FillWeight = 80 : 明細_dgv.Columns(6).FillWeight = 80 : 明細_dgv.Columns(7).FillWeight = 80
  28. 明細_dgv.Columns(8).FillWeight = 80 : 明細_dgv.Columns(9).Visible = False : 明細_dgv.Columns(10).Visible = False : 明細_dgv.Columns(11).Visible = False
  29. 明細_dgv.Columns(12).Visible = False : 明細_dgv.Columns(13).Visible = False : 明細_dgv.Columns(14).Visible = False : 明細_dgv.Columns(15).Visible = False
  30. 明細_dgv.Columns(16).Visible = False : 明細_dgv.Columns(17).Visible = False : 明細_dgv.Columns(18).Visible = False : 明細_dgv.Columns(19).Visible = False
  31. 明細_dgv.Columns(20).Visible = False : 明細_dgv.Columns(21).Visible = False : 明細_dgv.Columns(22).Visible = False : 明細_dgv.Columns(23).Visible = False
  32. 明細_dgv.Columns(24).Visible = False : 明細_dgv.Columns(25).FillWeight = 80
  33. 明細_dgv.Columns(6).DefaultCellStyle.Format = "#,##0" : 明細_dgv.Columns(7).DefaultCellStyle.Format = "#,##0" : 明細_dgv.Columns(8).DefaultCellStyle.Format = "#,##0"
  34. 明細_dgv.Columns(7).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : 明細_dgv.Columns(6).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
  35. 明細_dgv.Columns(8).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
  36. 明細_dgv.Columns(7).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter : 明細_dgv.Columns(6).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
  37. 明細_dgv.Columns(8).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
  38. If 低網速模式 = False Then
  39. 明細_dgv.Columns("Image").FillWeight = 80 : 明細_dgv.Columns("Image").Visible = True
  40. Dim mycol As DataGridViewImageColumn = 明細_dgv.Columns("Image")
  41. mycol.ImageLayout = DataGridViewImageCellLayout.Zoom
  42. Else
  43. If 明細_dgv.Columns.Count = 27 Then
  44. 明細_dgv.Columns("Image").Visible = False
  45. End If
  46. End If
  47. 新項次 = "00"
  48. For i As Integer = 0 To 明細_dgv.Rows.Count - 1
  49. NUM1 = Double.Parse(新項次) + 1
  50. If NUM1 < 10 Then : 新項次 = "0" & NUM1
  51. ElseIf NUM1 > 9 And NUM1 < 100 Then : 新項次 = NUM1
  52. End If
  53. 明細_dgv.Rows(i).Cells(表頭(2)).Value = 新項次
  54. '-------------------------規格合併呈現----------------------------------------------------------------------------------------------------------------------------------------
  55. If i = 0 Then
  56. PA3 = 明細_dgv.Rows(i).Cells("規格庫抬頭指定").Value
  57. SQL_規格庫抬頭讀取()
  58. If dr.Read() Then
  59. AAA1 = dr("A1") : AAA2 = dr("A2") : AAA3 = dr("A3") : AAA4 = dr("A4") : AAA5 = dr("A5") : AAA6 = dr("A6") : AAA7 = dr("A7") : AAA8 = dr("A8")
  60. End If
  61. conn.Close()
  62. Else
  63. If 明細_dgv.Rows(i).Cells("規格庫抬頭指定").Value.ToString <> 明細_dgv.Rows(i - 1).Cells("規格庫抬頭指定").Value.ToString Then
  64. AAA1 = "" : AAA2 = "" : AAA3 = "" : AAA4 = "" : AAA5 = "" : AAA6 = "" : AAA7 = "" : AAA8 = "" ' 不同的抬頭入資料前,先清除
  65. PA3 = 明細_dgv.Rows(i).Cells("規格庫抬頭指定").Value
  66. SQL_規格庫抬頭讀取()
  67. If dr.Read() Then
  68. AAA1 = dr("A1") : AAA2 = dr("A2") : AAA3 = dr("A3") : AAA4 = dr("A4") : AAA5 = dr("A5") : AAA6 = dr("A6") : AAA7 = dr("A7") : AAA8 = dr("A8")
  69. End If
  70. conn.Close()
  71. End If
  72. End If
  73. Dim ZA1, ZA2, ZA3, ZA4, ZA5, ZA6, ZA7, ZA8 As String : 物料規格 = ""
  74. If 詳細資料2_ch.Checked = True Then
  75. If 明細_dgv.Rows(i).Cells(表頭(13)).Value.ToString <> "" Then
  76. ZA1 = AAA1 & "=" & 明細_dgv.Rows(i).Cells(表頭(13)).Value.ToString : 物料規格 = ZA1 : End If
  77. If 明細_dgv.Rows(i).Cells("A2").Value.ToString <> "" Then : ZA2 = AAA2 & "=" & 明細_dgv.Rows(i).Cells("A2").Value
  78. If 物料規格 = "" Then : 物料規格 = ZA2 : Else : 物料規格 = 物料規格 + "、" + ZA2 : End If : End If
  79. If 明細_dgv.Rows(i).Cells("A3").Value.ToString <> "" Then : ZA3 = AAA3 & "=" & 明細_dgv.Rows(i).Cells("A3").Value
  80. If 物料規格 = "" Then : 物料規格 = ZA3 : Else : 物料規格 = 物料規格 + "、" + ZA3 : End If : End If
  81. If 明細_dgv.Rows(i).Cells("A4").Value.ToString <> "" Then : ZA4 = AAA4 & "=" & 明細_dgv.Rows(i).Cells("A4").Value
  82. If 物料規格 = "" Then : 物料規格 = ZA4 : Else : 物料規格 = 物料規格 + "、" + ZA4 : End If : End If
  83. If 明細_dgv.Rows(i).Cells("A5").Value.ToString <> "" Then : ZA5 = AAA5 & "=" & 明細_dgv.Rows(i).Cells("A5").Value
  84. If 物料規格 = "" Then : 物料規格 = ZA5 : Else : 物料規格 = 物料規格 + "、" + ZA5 : End If : End If
  85. If 明細_dgv.Rows(i).Cells("A6").Value.ToString <> "" Then : ZA6 = AAA6 & "=" & 明細_dgv.Rows(i).Cells("A6").Value
  86. If 物料規格 = "" Then : 物料規格 = ZA6 : Else : 物料規格 = 物料規格 + "、" + ZA6 : End If : End If
  87. If 明細_dgv.Rows(i).Cells("A7").Value.ToString <> "" Then : ZA7 = AAA7 & "=" & 明細_dgv.Rows(i).Cells("A7").Value
  88. If 物料規格 = "" Then : 物料規格 = ZA7 : Else : 物料規格 = 物料規格 + "、" + ZA7 : End If : End If
  89. If 明細_dgv.Rows(i).Cells("A8").Value.ToString <> "" Then : ZA8 = AAA8 & "=" & 明細_dgv.Rows(i).Cells("A8").Value
  90. If 物料規格 = "" Then : 物料規格 = ZA8 : Else : 物料規格 = 物料規格 + "、" + ZA8 : End If : End If
  91. Else
  92. If 明細_dgv.Rows(i).Cells(表頭(13)).Value.ToString <> "" Then : ZA1 = 明細_dgv.Rows(i).Cells(表頭(13)).Value.ToString : 物料規格 = ZA1 : End If
  93. If 明細_dgv.Rows(i).Cells("A2").Value.ToString <> "" Then
  94. ZA2 = 明細_dgv.Rows(i).Cells("A2").Value : If 物料規格 = "" Then : 物料規格 = ZA2 : Else : 物料規格 = 物料規格 + "、" + ZA2 : End If : End If
  95. If 明細_dgv.Rows(i).Cells("A3").Value.ToString <> "" Then
  96. ZA3 = 明細_dgv.Rows(i).Cells("A3").Value : If 物料規格 = "" Then : 物料規格 = ZA3 : Else : 物料規格 = 物料規格 + "、" + ZA3 : End If : End If
  97. If 明細_dgv.Rows(i).Cells("A4").Value.ToString <> "" Then
  98. ZA4 = 明細_dgv.Rows(i).Cells("A4").Value : If 物料規格 = "" Then : 物料規格 = ZA4 : Else : 物料規格 = 物料規格 + "、" + ZA4 : End If : End If
  99. If 明細_dgv.Rows(i).Cells("A5").Value.ToString <> "" Then
  100. ZA5 = 明細_dgv.Rows(i).Cells("A5").Value : If 物料規格 = "" Then : 物料規格 = ZA5 : Else : 物料規格 = 物料規格 + "、" + ZA5 : End If : End If
  101. If 明細_dgv.Rows(i).Cells("A6").Value.ToString <> "" Then
  102. ZA6 = 明細_dgv.Rows(i).Cells("A6").Value : If 物料規格 = "" Then : 物料規格 = ZA6 : Else : 物料規格 = 物料規格 + "、" + ZA6 : End If : End If
  103. If 明細_dgv.Rows(i).Cells("A7").Value.ToString <> "" Then
  104. ZA7 = 明細_dgv.Rows(i).Cells("A7").Value : If 物料規格 = "" Then : 物料規格 = ZA7 : Else : 物料規格 = 物料規格 + "、" + ZA7 : End If : End If
  105. If 明細_dgv.Rows(i).Cells("A8").Value.ToString <> "" Then
  106. ZA8 = 明細_dgv.Rows(i).Cells("A8").Value : If 物料規格 = "" Then : 物料規格 = ZA8 : Else : 物料規格 = 物料規格 + "、" + ZA8 : End If : End If
  107. End If
  108. 明細_dgv.Rows(i).Cells(表頭(13)).Value = 物料規格
  109. Next i
  110. 總金額計算() : Set_清單_1()
  111. End Sub
  112. Private Sub Set_清單_1()
  113. Dim ds5 As New DataSet : 明細1_dgv.DataSource = Nothing : ds5.Clear()
  114. 明細1_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  115. 明細1_dgv.ColumnHeadersHeight = 40
  116. 明細1_dgv.AllowUserToAddRows = False
  117. 明細1_dgv.RowTemplate.Height = 35
  118. SQL_建築物料採購單一覽表_明細()
  119. da.Fill(ds5) : 明細1_dgv.DataSource = ds5.Tables(0) : conn.Close()
  120. If 低網速模式 = False Then
  121. 明細1_dgv.Columns("Image").FillWeight = 80 : 明細1_dgv.Columns("Image").Visible = True
  122. Dim mycol As DataGridViewImageColumn = 明細1_dgv.Columns("Image")
  123. mycol.ImageLayout = DataGridViewImageCellLayout.Zoom
  124. Else
  125. If 明細1_dgv.Columns.Count = 27 Then
  126. 明細1_dgv.Columns("Image").Visible = False
  127. End If
  128. End If
  129. 新項次 = "00"
  130. For i As Integer = 0 To 明細1_dgv.Rows.Count - 1
  131. NUM1 = Double.Parse(新項次) + 1
  132. If NUM1 < 10 Then : 新項次 = "0" & NUM1
  133. ElseIf NUM1 > 9 And NUM1 < 100 Then : 新項次 = NUM1
  134. End If
  135. 明細1_dgv.Rows(i).Cells(表頭(2)).Value = 新項次
  136. '-------------------------------------------------------------------------------------------------------------------------
  137. If i = 0 Then
  138. AAA1 = "" : AAA2 = "" : AAA3 = "" : AAA4 = "" : AAA5 = "" : AAA6 = "" : AAA7 = "" : AAA8 = ""
  139. PA3 = 明細1_dgv.Rows(i).Cells("規格庫抬頭指定").Value : PA20 = 系統語言_cb.Text
  140. SQL_規格庫抬頭讀取_列印用()
  141. If dr.Read() Then
  142. AAA1 = dr("A1") : AAA2 = dr("A2") : AAA3 = dr("A3") : AAA4 = dr("A4") : AAA5 = dr("A5") : AAA6 = dr("A6") : AAA7 = dr("A7") : AAA8 = dr("A8")
  143. End If
  144. conn.Close()
  145. Else
  146. If 明細1_dgv.Rows(i).Cells("規格庫抬頭指定").Value.ToString <> 明細1_dgv.Rows(i - 1).Cells("規格庫抬頭指定").Value.ToString Then
  147. AAA1 = "" : AAA2 = "" : AAA3 = "" : AAA4 = "" : AAA5 = "" : AAA6 = "" : AAA7 = "" : AAA8 = ""
  148. PA3 = 明細1_dgv.Rows(i).Cells("規格庫抬頭指定").Value : PA20 = 系統語言_cb.Text
  149. SQL_規格庫抬頭讀取_列印用()
  150. If dr.Read() Then
  151. AAA1 = dr("A1") : AAA2 = dr("A2") : AAA3 = dr("A3") : AAA4 = dr("A4") : AAA5 = dr("A5") : AAA6 = dr("A6") : AAA7 = dr("A7") : AAA8 = dr("A8")
  152. End If
  153. conn.Close()
  154. End If
  155. End If
  156. Dim ZA1, ZA2, ZA3, ZA4, ZA5, ZA6, ZA7, ZA8 As String : 物料規格 = ""
  157. If 詳細資料2_ch.Checked = True Then
  158. If 明細1_dgv.Rows(i).Cells(表頭(13)).Value.ToString <> "" Then
  159. ZA1 = AAA1 & "=" & 明細1_dgv.Rows(i).Cells(表頭(13)).Value.ToString : 物料規格 = ZA1 : End If
  160. If 明細1_dgv.Rows(i).Cells("A2").Value.ToString <> "" Then : ZA2 = AAA2 & "=" & 明細1_dgv.Rows(i).Cells("A2").Value
  161. If 物料規格 = "" Then : 物料規格 = ZA2 : Else : 物料規格 = 物料規格 + "、" + ZA2 : End If : End If
  162. If 明細1_dgv.Rows(i).Cells("A3").Value.ToString <> "" Then : ZA3 = AAA3 & "=" & 明細1_dgv.Rows(i).Cells("A3").Value
  163. If 物料規格 = "" Then : 物料規格 = ZA3 : Else : 物料規格 = 物料規格 + "、" + ZA3 : End If : End If
  164. If 明細1_dgv.Rows(i).Cells("A4").Value.ToString <> "" Then : ZA4 = AAA4 & "=" & 明細1_dgv.Rows(i).Cells("A4").Value
  165. If 物料規格 = "" Then : 物料規格 = ZA4 : Else : 物料規格 = 物料規格 + "、" + ZA4 : End If : End If
  166. If 明細1_dgv.Rows(i).Cells("A5").Value.ToString <> "" Then : ZA5 = AAA5 & "=" & 明細1_dgv.Rows(i).Cells("A5").Value
  167. If 物料規格 = "" Then : 物料規格 = ZA5 : Else : 物料規格 = 物料規格 + "、" + ZA5 : End If : End If
  168. If 明細1_dgv.Rows(i).Cells("A6").Value.ToString <> "" Then : ZA6 = AAA6 & "=" & 明細1_dgv.Rows(i).Cells("A6").Value
  169. If 物料規格 = "" Then : 物料規格 = ZA6 : Else : 物料規格 = 物料規格 + "、" + ZA6 : End If : End If
  170. If 明細1_dgv.Rows(i).Cells("A7").Value.ToString <> "" Then : ZA7 = AAA7 & "=" & 明細1_dgv.Rows(i).Cells("A7").Value
  171. If 物料規格 = "" Then : 物料規格 = ZA7 : Else : 物料規格 = 物料規格 + "、" + ZA7 : End If : End If
  172. If 明細1_dgv.Rows(i).Cells("A8").Value.ToString <> "" Then : ZA8 = AAA8 & "=" & 明細1_dgv.Rows(i).Cells("A8").Value
  173. If 物料規格 = "" Then : 物料規格 = ZA8 : Else : 物料規格 = 物料規格 + "、" + ZA8 : End If : End If
  174. Else
  175. If 明細1_dgv.Rows(i).Cells(表頭(13)).Value.ToString <> "" Then : ZA1 = 明細1_dgv.Rows(i).Cells(表頭(13)).Value.ToString : 物料規格 = ZA1 : End If
  176. If 明細1_dgv.Rows(i).Cells("A2").Value.ToString <> "" Then
  177. ZA2 = 明細1_dgv.Rows(i).Cells("A2").Value : If 物料規格 = "" Then : 物料規格 = ZA2 : Else : 物料規格 = 物料規格 + "、" + ZA2 : End If : End If
  178. If 明細1_dgv.Rows(i).Cells("A3").Value.ToString <> "" Then
  179. ZA3 = 明細1_dgv.Rows(i).Cells("A3").Value : If 物料規格 = "" Then : 物料規格 = ZA3 : Else : 物料規格 = 物料規格 + "、" + ZA3 : End If : End If
  180. If 明細1_dgv.Rows(i).Cells("A4").Value.ToString <> "" Then
  181. ZA4 = 明細1_dgv.Rows(i).Cells("A4").Value : If 物料規格 = "" Then : 物料規格 = ZA4 : Else : 物料規格 = 物料規格 + "、" + ZA4 : End If : End If
  182. If 明細1_dgv.Rows(i).Cells("A5").Value.ToString <> "" Then
  183. ZA5 = 明細1_dgv.Rows(i).Cells("A5").Value : If 物料規格 = "" Then : 物料規格 = ZA5 : Else : 物料規格 = 物料規格 + "、" + ZA5 : End If : End If
  184. If 明細1_dgv.Rows(i).Cells("A6").Value.ToString <> "" Then
  185. ZA6 = 明細1_dgv.Rows(i).Cells("A6").Value : If 物料規格 = "" Then : 物料規格 = ZA6 : Else : 物料規格 = 物料規格 + "、" + ZA6 : End If : End If
  186. If 明細1_dgv.Rows(i).Cells("A7").Value.ToString <> "" Then
  187. ZA7 = 明細1_dgv.Rows(i).Cells("A7").Value : If 物料規格 = "" Then : 物料規格 = ZA7 : Else : 物料規格 = 物料規格 + "、" + ZA7 : End If : End If
  188. If 明細1_dgv.Rows(i).Cells("A8").Value.ToString <> "" Then
  189. ZA8 = 明細1_dgv.Rows(i).Cells("A8").Value : If 物料規格 = "" Then : 物料規格 = ZA8 : Else : 物料規格 = 物料規格 + "、" + ZA8 : End If : End If
  190. End If
  191. 明細1_dgv.Rows(i).Cells(表頭(13)).Value = 物料規格
  192. Next i
  193. End Sub
  194. Private Sub Set_清單1()
  195. Dim ds1 As New DataSet : 已核准_dgv.DataSource = Nothing : ds1.Clear()
  196. 已核准_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  197. 已核准_dgv.ColumnHeadersHeight = 40 : 已核准_dgv.RowTemplate.Height = 30
  198. 已核准_dgv.AllowUserToAddRows = False
  199. If 全部資料_cb.Checked = True Then : SQL_建築物料採購單一覽表_已核准() : Else : SQL_建築物料採購單一覽表_已核准1() : End If
  200. da.Fill(ds1) : 已核准_dgv.DataSource = ds1.Tables(0) : conn.Close()
  201. 已核准_dgv.Columns(表頭(0)).FillWeight = 40 : 已核准_dgv.Columns(表頭(1)).FillWeight = 40 : 已核准_dgv.Columns(25).FillWeight = 40
  202. 已核准_dgv.Columns(21).FillWeight = 180 : 已核准_dgv.Columns(26).FillWeight = 40 : 已核准_dgv.Columns(27).FillWeight = 40
  203. 已核准_dgv.Columns(22).DefaultCellStyle.Format = "#,##0" : 已核准_dgv.Columns(23).DefaultCellStyle.Format = "#,##0"
  204. 已核准_dgv.Columns(24).DefaultCellStyle.Format = "#,##0"
  205. 已核准_dgv.Columns(22).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  206. 已核准_dgv.Columns(23).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  207. 已核准_dgv.Columns(24).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  208. 已核准_dgv.EditMode = DataGridViewEditMode.EditOnEnter
  209. Dim mycol1 As DataGridViewImageColumn = 已核准_dgv.Columns("Select All") : mycol1.ImageLayout = DataGridViewImageCellLayout.Zoom
  210. Dim mycol2 As DataGridViewImageColumn = 已核准_dgv.Columns("To DK") : mycol2.ImageLayout = DataGridViewImageCellLayout.Zoom
  211. Dim mycol3 As DataGridViewImageColumn = 已核准_dgv.Columns("Save") : mycol3.ImageLayout = DataGridViewImageCellLayout.Zoom
  212. For i As Integer = 0 To 已核准_dgv.Rows.Count - 1
  213. Dim 折扣, 稅金 As Long : 折扣 = 0 : 稅金 = 0
  214. 已核准_dgv.Rows(i).Cells("Select All").Value = My.Resources.add_1 : 已核准_dgv.Rows(i).Cells("To DK").Value = My.Resources.Money2
  215. 已核准_dgv.Rows(i).Cells("Save").Value = My.Resources.SAVER : 已核准_dgv.Rows(i).Cells(表頭(8)).Value = 0
  216. If 已核准_dgv.Rows(i).Cells("DISC").Value <> 0 Then : 折扣 = 已核准_dgv.Rows(i).Cells(表頭(7)).Value / 100 * 已核准_dgv.Rows(i).Cells("DISC").Value : End If
  217. If 已核准_dgv.Rows(i).Cells("PPN").Value <> 0 Then : 稅金 = 已核准_dgv.Rows(i).Cells(表頭(7)).Value / 100 * 已核准_dgv.Rows(i).Cells("PPN").Value : End If
  218. 已核准_dgv.Rows(i).Cells(表頭(7)).Value += (稅金 - 折扣)
  219. Next
  220. 已核准_dgv.Columns(0).FillWeight = 125
  221. For i As Integer = 1 To 20 : 已核准_dgv.Columns(i).Visible = False : Next
  222. If 已核准_dgv.Size.Width = 255 Then
  223. For i As Integer = 21 To 27 : 已核准_dgv.Columns(i).Visible = False : Next
  224. Else
  225. For i As Integer = 21 To 27 : 已核准_dgv.Columns(i).Visible = True : Next
  226. End If
  227. 已核准_dgv.Columns(0).ReadOnly = True : 已核准_dgv.Columns(21).ReadOnly = True : 已核准_dgv.Columns(23).ReadOnly = True : 已核准_dgv.Columns(24).ReadOnly = True
  228. 已核准_dgv.Columns(25).ReadOnly = True : 已核准_dgv.Columns(26).ReadOnly = True : 已核准_dgv.Columns(27).ReadOnly = True : 已核准_dgv.Columns(28).ReadOnly = True
  229. 已核准_dgv.Columns(29).ReadOnly = True
  230. End Sub
  231. Private Sub 打開清單()
  232. If 已核准_dgv.Size.Width = 255 Then
  233. 已核准_dgv.Size = New Size(915, 已核准_dgv.Size.Height)
  234. For i As Integer = 21 To 27 : 已核准_dgv.Columns(i).Visible = True : Next
  235. Else
  236. 已核准_dgv.Size = New Size(255, 已核准_dgv.Size.Height)
  237. For i As Integer = 21 To 27 : 已核准_dgv.Columns(i).Visible = False : Next
  238. End If
  239. End Sub
  240. Private Sub Set_清單2()
  241. Dim ds2 As New DataSet : 已作廢_dgv.DataSource = Nothing : ds2.Clear()
  242. 已作廢_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  243. 已作廢_dgv.ColumnHeadersHeight = 25
  244. 已作廢_dgv.AllowUserToAddRows = False
  245. SQL_建築物料採購單一覽表_已作廢()
  246. da.Fill(ds2) : 已作廢_dgv.DataSource = ds2.Tables(0) : conn.Close()
  247. 已作廢_dgv.Columns(0).FillWeight = 125 : 已作廢_dgv.Columns(1).Visible = False : 已作廢_dgv.Columns(2).Visible = False : 已作廢_dgv.Columns(3).Visible = False
  248. 已作廢_dgv.Columns(4).Visible = False : 已作廢_dgv.Columns(5).Visible = False : 已作廢_dgv.Columns(6).Visible = False : 已作廢_dgv.Columns(7).Visible = False
  249. 已作廢_dgv.Columns(8).Visible = False : 已作廢_dgv.Columns(9).Visible = False : 已作廢_dgv.Columns(10).Visible = False : 已作廢_dgv.Columns(11).Visible = False
  250. 已作廢_dgv.Columns(12).Visible = False : 已作廢_dgv.Columns(13).Visible = False : 已作廢_dgv.Columns(14).Visible = False : 已作廢_dgv.Columns(15).Visible = False
  251. 已作廢_dgv.Columns(16).Visible = False
  252. End Sub
  253. Private Sub ComboBox2下拉表單資料載入()
  254. SQL_供應商資料表_公司名_下拉用() : 廠商_cb.Items.Clear() : While (dr.Read()) : 廠商_cb.Items.Add(dr("公司名")) : End While : conn.Close()
  255. End Sub
  256. Private Sub 總金額計算()
  257. Dim FFGG As Integer = 0
  258. 總金額_tb.Text = "0"
  259. For i As Integer = 0 To 明細_dgv.Rows.Count - 1
  260. 明細_dgv.Rows(i).Cells(表頭(27)).Value = 明細_dgv.Rows(i).Cells(表頭(26)).Value * 明細_dgv.Rows(i).Cells(表頭(15)).Value
  261. FFGG = Val(FFGG) + 明細_dgv.Rows(i).Cells(表頭(27)).Value
  262. Next i
  263. 折扣金額_tb.Text = Val(折扣比_tb.Text) * FFGG / 100
  264. If 稅金計算_ch.Checked = True Then
  265. If 折扣比_tb.Text = "0" Then
  266. 稅金金額_tb.Text = FFGG * Val(稅金比_tb.Text) / 100
  267. Else
  268. 稅金金額_tb.Text = (FFGG - 折扣金額_tb.Text) * Val(稅金比_tb.Text) / 100
  269. End If
  270. Else
  271. 稅金金額_tb.Text = "0"
  272. End If
  273. 總金額_tb.Text = FFGG - Val(折扣金額_tb.Text) + Val(稅金金額_tb.Text)
  274. 折扣金額_tb.Text = Strings.Format(Val(折扣金額_tb.Text), "#,##0") : 稅金金額_tb.Text = Strings.Format(Val(稅金金額_tb.Text), "#,##0")
  275. 總金額_tb.Text = Strings.Format(Val(總金額_tb.Text), "#,##0")
  276. End Sub
  277. Private Sub 語言轉換讀取()
  278. If 系統語言 = "繁體中文" Then : 語言 = "CH" : ElseIf 系統語言 = "English" Then : 語言 = "EN" : ElseIf 系統語言 = "Indonesian" Then : 語言 = "IN" : End If
  279. 一級簽核_lb.Text = 系統語言字典("H208-100-" & 語言) : 二級簽核_lb.Text = 系統語言字典("H208-101-" & 語言) : 已作廢_lb.Text = 系統語言字典("H208-102-" & 語言)
  280. 已核准_lb.Text = 系統語言字典("H208-103-" & 語言) : 表頭(19) = 系統語言字典("H208-104-" & 語言) : 表頭(134) = 系統語言字典("H208-105-" & 語言)
  281. 表頭(27) = 系統語言字典("H208-106-" & 語言) : 表頭(12) = 系統語言字典("H208-107-" & 語言) : 表頭(13) = 系統語言字典("H208-108-" & 語言)
  282. 表頭(14) = 系統語言字典("H208-109-" & 語言) : 表頭(16) = 系統語言字典("H208-110-" & 語言) : 表頭(18) = 系統語言字典("H208-111-" & 語言)
  283. 表頭(26) = 系統語言字典("H208-112-" & 語言) : 表頭(2) = 系統語言字典("H208-113-" & 語言) : 表頭(15) = 系統語言字典("H208-114-" & 語言)
  284. 圖片編碼_lb.Text = 系統語言字典("H208-115-" & 語言) : 對話框(0) = 系統語言字典("H208-116-" & 語言) : 選擇公司_lb.Text = 系統語言字典("H208-117-" & 語言)
  285. 總金額_lb.Text = 系統語言字典("H208-118-" & 語言) : 驗證碼_lb.Text = 系統語言字典("H208-119-" & 語言) : 重新整理_tsm.Text = 系統語言字典("H208-120-" & 語言)
  286. Me.Text = 系統語言字典("H001-169-" & 語言) : 表頭(0) = 系統語言字典("H206-145-" & 語言) : 表頭(1) = 系統語言字典("H206-146-" & 語言)
  287. 對話框(1) = 系統語言字典("H208-121-" & 語言) : 對話框(2) = 系統語言字典("H208-122-" & 語言) : 對話框(3) = 系統語言字典("H208-123-" & 語言)
  288. 對話框(4) = 系統語言字典("H314-117-" & 語言) : 對話框(5) = 系統語言字典("H314-118-" & 語言) : 對話框(6) = 系統語言字典("H314-119-" & 語言)
  289. 對話框(7) = 系統語言字典("H314-122-" & 語言) : 表頭(8) = 系統語言字典("H314-120-" & 語言) : 表頭(9) = 系統語言字典("H314-121-" & 語言)
  290. 表頭(6) = 系統語言字典("H299-109-" & 語言) : 表頭(7) = 系統語言字典("H304-103-" & 語言)
  291. End Sub
  292. Private Sub 採購單歷史檔案_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  293. Me.MdiParent = HX_PGS_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True
  294. 風格() : H(208) = True : 介面 = "H208" : 語言轉換讀取() : 顯示說明(999, False) : Panel1.SendToBack()
  295. 核對員_tb.Visible = False : 核對日期_tb.Visible = False : 詢價員_tb.Visible = False : 尋價日期_tb.Visible = False
  296. 驗證碼1_tb.Visible = False : 供應商編碼_tb.Visible = False : 系統語言_cb.Text = "Indonesian"
  297. SQL_採購單控制表轉財務金額_歸零() : ComboBox2下拉表單資料載入() : Set_清單1() : Set_清單2()
  298. MyMod.清單字體大小調整()
  299. 已核准_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
  300. 明細_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
  301. End Sub
  302. Private Sub 採購單歷史檔案_SizeChanged(sender As Object, e As EventArgs) Handles MyBase.SizeChanged
  303. MyMod.清單字體大小調整()
  304. 已核准_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
  305. 明細_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
  306. End Sub
  307. Private Sub 採購單詢價_Closed(sender As Object, e As EventArgs) Handles MyBase.Closed
  308. H(208) = False : MyMod.虛擬桌面開啟()
  309. End Sub
  310. Private Sub 語轉扭_bt_Click(sender As Object, e As EventArgs) Handles 語轉扭_bt.Click
  311. 介面 = "H208" : 語言轉換讀取()
  312. Set_清單1() : Set_清單2() : Set_清單()
  313. End Sub
  314. Private Sub 登入閒置控制_MouseMove(sender As Object, e As EventArgs) Handles MyBase.MouseMove
  315. timeNow = 0 : HX_PGS_ERP_SYS.Timer1.Enabled = False : HX_PGS_ERP_SYS.Timer1.Enabled = True
  316. End Sub
  317. Private Sub 登入閒置控制_KeyPress(sender As Object, e As EventArgs) Handles MyBase.KeyPress
  318. timeNow = 0 : HX_PGS_ERP_SYS.Timer1.Enabled = False : HX_PGS_ERP_SYS.Timer1.Enabled = True
  319. End Sub
  320. Dim 已超出 As Boolean
  321. Private Sub 已核准_dgv_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles 已核准_dgv.RowPostPaint
  322. Dim linePen As New Pen(Color.Blue, 2)
  323. If e.RowIndex = 已核准_dgv.Rows.Count - 1 Then : Exit Sub : Else
  324. If 已核准_dgv(21, e.RowIndex).Value.ToString <> 已核准_dgv(21, e.RowIndex + 1).Value.ToString Then
  325. Dim startX As Integer = IIf(已核准_dgv.RowHeadersVisible, 已核准_dgv.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  326. Dim endX As Integer = startX + 已核准_dgv.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - 已核准_dgv.HorizontalScrollingOffset
  327. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  328. End If
  329. End If
  330. End Sub
  331. Private Sub 已核准_dgv_CellEnter(sender As Object, e As DataGridViewCellEventArgs) Handles 已核准_dgv.CellEndEdit
  332. If 已核准_dgv.Rows(e.RowIndex).Cells(22).Value > 已核准_dgv.Rows(e.RowIndex).Cells(24).Value - 已核准_dgv.Rows(e.RowIndex).Cells(23).Value Then
  333. 已核准_dgv.Rows(e.RowIndex).Cells(22).Value = 已核准_dgv.Rows(e.RowIndex).Cells(24).Value - 已核准_dgv.Rows(e.RowIndex).Cells(23).Value
  334. End If
  335. End Sub
  336. Private Sub 已核准_dgv_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles 已核准_dgv.MouseUp
  337. If 已核准_dgv.SelectedCells.Count > 0 Then
  338. If 已核准_dgv.SelectedCells(0).ColumnIndex = 25 Then
  339. 已核准_dgv.Rows(已核准_dgv.SelectedCells(0).RowIndex).Cells(22).Value =
  340. 已核准_dgv.Rows(已核准_dgv.SelectedCells(0).RowIndex).Cells(24).Value - 已核准_dgv.Rows(已核准_dgv.SelectedCells(0).RowIndex).Cells(23).Value
  341. ElseIf 已核准_dgv.SelectedCells(0).ColumnIndex = 26 Then
  342. 轉財務單.PerformClick()
  343. ElseIf 已核准_dgv.SelectedCells(0).ColumnIndex = 27 Then
  344. If 財物支付單申請_傳票.申請金額_nud.Value <> 0 Then : PA21 = "" : PA22 = "" : PA23 = "" : PA24 = "" : PA25 = "" : PA26 = ""
  345. If 財物支付單申請_傳票.支付對象_tb.Text = "" Then : PA21 = 對話框(4) : PA22 = " " & 財物支付單申請_傳票.Label18.Text & " " : PA26 = " " & 對話框(5) & " " : End If
  346. If 財物支付單申請_傳票.營行帳號_tb.Text = "" Then : PA21 = 對話框(4) : PA23 = " " & 財物支付單申請_傳票.Label15.Text & " " : PA26 = " " & 對話框(5) & " " : End If
  347. If 財物支付單申請_傳票.支付銀行_tb.Text = "" Then : PA21 = 對話框(4) : PA24 = " " & 財物支付單申請_傳票.Label17.Text & " " : PA26 = " " & 對話框(5) & " " : End If
  348. If 財物支付單申請_傳票.銀行支行_tb.Text = "" Then : PA21 = 對話框(4) : PA25 = " " & 財物支付單申請_傳票.Label16.Text & " " : PA26 = " " & 對話框(5) & " " : End If
  349. MGB(對話框(7) & vbCrLf & PA21 & PA22 & PA23 & PA24 & PA25 & PA26, 2) : 首次開啟 = False
  350. If 訊息回應 = "YES" Then
  351. 財物支付單申請_傳票.開立收支單1_bt.PerformClick()
  352. Dim XS As Integer = 0 : Dim SRTG As String = ""
  353. Dim currentTime As DateTime = DateTime.Now
  354. For i As Integer = 0 To 已核准_dgv.Rows.Count - 1
  355. If 已核准_dgv.Rows(i).Cells(22).Value <> 0 Then
  356. If XS < 9 Then : SRTG = "HP" & currentTime.ToString("yyyyMMddHHmmss") & "00" & XS + 1
  357. ElseIf XS < 99 Then : SRTG = "HP" & currentTime.ToString("yyyyMMddHHmmss") & "0" & XS + 1
  358. ElseIf XS < 999 Then : SRTG = "HP" & currentTime.ToString("yyyyMMddHHmmss") & XS + 1 : End If
  359. If XS = 0 Then
  360. SQL2 = "('" & 財物支付單申請_傳票.單號_tb.Text & "', '" & 已核准_dgv.Rows(i).Cells(0).Value.ToString & "',
  361. '" & 已核准_dgv.Rows(i).Cells(22).Value.ToString & "', '" & SRTG & "')"
  362. Else
  363. SQL2 &= ", ('" & 財物支付單申請_傳票.單號_tb.Text & "', '" & 已核准_dgv.Rows(i).Cells(0).Value.ToString & "',
  364. '" & 已核准_dgv.Rows(i).Cells(22).Value.ToString & "', '" & SRTG & "')"
  365. End If
  366. PA42 = 已核准_dgv.Rows(i).Cells(22).Value + 已核准_dgv.Rows(i).Cells(23).Value : PA43 = 已核准_dgv.Rows(i).Cells(0).Value.ToString : PA44 = "1"
  367. SQL_採購轉財務金額修改_修改() : XS += 1
  368. End If
  369. Next : SQL_財務採購關聯表_新增() : Set_清單1() : MGB(對話框(6), 1) : 首次開啟 = False
  370. End If : PA21 = "" : PA22 = "" : PA23 = "" : PA24 = "" : PA25 = "" : PA26 = ""
  371. End If
  372. End If
  373. End If
  374. End Sub
  375. Private Sub 明細_dgv_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles 明細_dgv.MouseUp
  376. 'If 明細_dgv.SelectedCells.Count = 1 Then : 通知訊息 = 明細_dgv.SelectedCells(0).ColumnIndex & " " & 明細_dgv.SelectedCells(0).RowIndex) : End If
  377. If 明細_dgv.SelectedCells.Count = 1 Then : 已超出 = False : End If
  378. If 明細_dgv.SelectedCells.Count > 0 Then
  379. If 明細_dgv.SelectedCells(0).ColumnIndex = 8 Then
  380. If 已超出 = False Then
  381. Dim x As Double = 0
  382. For i As Integer = 0 To 明細_dgv.SelectedCells.Count - 1
  383. Dim 變數 As String = "" : Dim 取變數 As String
  384. 取變數 = 明細_dgv.Rows(明細_dgv.SelectedCells.Item(i).RowIndex).Cells(明細_dgv.SelectedCells.Item(i).ColumnIndex).Value
  385. For ii As Integer = 1 To Len(取變數)
  386. If ii = 1 Then : 變數 = Strings.Left(取變數, ii) : Else : If Strings.Mid(取變數, ii, 1) <> "," Then : 變數 &= Strings.Mid(取變數, ii, 1) : End If : End If
  387. Next : x += Val(變數)
  388. Next i : HX_PGS_ERP_SYS.合計_TSSL.Text = "Total : " & Strings.Format(x, "#,##0")
  389. Else : HX_PGS_ERP_SYS.合計_TSSL.Text = "Total : " & Strings.Format(0, "#,##0")
  390. End If
  391. Else : 已超出 = True : HX_PGS_ERP_SYS.合計_TSSL.Text = "Total : " & Strings.Format(0, "#,##0")
  392. End If
  393. End If
  394. End Sub
  395. Private Sub 明細_dgv_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles 明細_dgv.CellEnter
  396. 總金額_tb.Text = "0"
  397. For i As Integer = 0 To 明細_dgv.Rows.Count - 1
  398. 明細_dgv.Rows(i).Cells(表頭(27)).Value = 明細_dgv.Rows(i).Cells(表頭(26)).Value * 明細_dgv.Rows(i).Cells(表頭(15)).Value
  399. 總金額_tb.Text = Val(總金額_tb.Text) + 明細_dgv.Rows(i).Cells(表頭(27)).Value
  400. Next i
  401. 總金額_tb.Text = Strings.Format(Val(總金額_tb.Text), "#,##0")
  402. End Sub
  403. Private Sub 明細_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 明細_dgv.CellClick
  404. If e.RowIndex = -1 Then : Else
  405. PA1 = 明細_dgv.Rows(e.RowIndex).Cells("群組碼").Value : PA2 = 明細_dgv.Rows(e.RowIndex).Cells("料號原則").Value
  406. SQL_物料圖庫_圖檔讀取()
  407. While dr.Read() = True
  408. Dim unused As Byte() = New Byte(-1) {}
  409. Dim bytes As Byte() = DirectCast(dr.Item("圖檔"), Byte())
  410. Dim oStream As New MemoryStream(bytes)
  411. 物料圖檔_pb.Image = Bitmap.FromStream(oStream)
  412. End While
  413. conn.Close() : 物料圖檔_pb.SizeMode = 4
  414. End If
  415. End Sub
  416. Private Sub 已核准_dgv_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles 已核准_dgv.CellClick
  417. If e.RowIndex = -1 Then : Else
  418. 採購單號_tb.Text = 已核准_dgv(0, e.RowIndex).Value.ToString : 折扣比_tb.Text = 已核准_dgv(13, e.RowIndex).Value.ToString : 稅金計算_ch.Checked = 已核准_dgv(14, e.RowIndex).Value
  419. 稅金比_tb.Text = 已核准_dgv(15, e.RowIndex).Value.ToString : 核對員_tb.Text = 已核准_dgv(4, e.RowIndex).Value.ToString : 核對日期_tb.Text = 已核准_dgv(5, e.RowIndex).Value.ToString
  420. 詢價員_tb.Text = 已核准_dgv(6, e.RowIndex).Value.ToString : 尋價日期_tb.Text = 已核准_dgv(7, e.RowIndex).Value.ToString : 驗證碼1_tb.Text = 已核准_dgv(11, e.RowIndex).Value.ToString
  421. 審核日期1_tb.Text = 已核准_dgv("一級核准核准日期", e.RowIndex).Value.ToString : 審核日期2_tb.Text = 已核准_dgv("核准日期", e.RowIndex).Value.ToString
  422. 採購人員_tb.Text = 已核准_dgv("採購員", e.RowIndex).Value.ToString : 採購日期_tb.Text = 已核准_dgv("採購日期", e.RowIndex).Value.ToString
  423. 手動號碼_tb.Text = 已核准_dgv("手動號碼", e.RowIndex).Value.ToString
  424. If Strings.Left(採購單號_tb.Text, 3) = "HXI" Then : 選擇公司_cb.Text = "PT HONG XHE INDUSTRIAL"
  425. ElseIf Strings.Left(採購單號_tb.Text, 3) = "PGS" Then : 選擇公司_cb.Text = "PT PUNCAK GEMILANG SEMESTA" : End If
  426. 供應商編碼_tb.Text = 已核准_dgv(1, e.RowIndex).Value.ToString : conn.Close()
  427. PA1 = 供應商編碼_tb.Text : SQL_建築物料採購單生成_供應商資料一()
  428. If dr.Read() Then : 廠商_cb.Text = dr("公司名") : conn.Close() : End If : conn.Close()
  429. 驗證碼_tb.Text = 已核准_dgv(11, e.RowIndex).Value.ToString : 圖片編碼_tb.Text = 已核准_dgv(10, e.RowIndex).Value.ToString
  430. 使用地點_tb.Text = 已核准_dgv(3, e.RowIndex).Value.ToString : 需求日期_dtp.Value = 已核准_dgv(2, e.RowIndex).Value
  431. PA1 = 已核准_dgv("一級核准簽名檔編號", e.RowIndex).Value.ToString : SQL_主管簽名檔管理_圖片流水號()
  432. 簽名檔1_pb.Image = Nothing
  433. While dr.Read() = True
  434. Dim unused As Byte() = New Byte(-1) {}
  435. Dim bytes As Byte() = DirectCast(dr.Item("簽名檔圖片"), Byte())
  436. Dim oStream As New MemoryStream(bytes)
  437. 簽名檔1_pb.Image = Bitmap.FromStream(oStream)
  438. End While
  439. conn.Close() : 簽名檔1_pb.SizeMode = 4
  440. Set_清單()
  441. QRCode2_rb.Value = 驗證碼1_tb.Text : QRCode1_rb.Value = 驗證碼1_tb.Text
  442. QRCode_pb.Image = QRCode1_rb.ExportToImage()
  443. End If
  444. End Sub
  445. Private Sub 已作廢_dgv_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles 已作廢_dgv.CellClick
  446. If e.RowIndex = -1 Then : Else
  447. 採購單號_tb.Text = 已作廢_dgv(0, e.RowIndex).Value.ToString : 折扣比_tb.Text = 已作廢_dgv(13, e.RowIndex).Value.ToString : 稅金計算_ch.Checked = 已作廢_dgv(14, e.RowIndex).Value
  448. 稅金比_tb.Text = 已作廢_dgv(15, e.RowIndex).Value.ToString : 核對員_tb.Text = 已作廢_dgv(4, e.RowIndex).Value.ToString : 核對日期_tb.Text = 已作廢_dgv(5, e.RowIndex).Value.ToString
  449. 詢價員_tb.Text = 已作廢_dgv(6, e.RowIndex).Value.ToString : 尋價日期_tb.Text = 已作廢_dgv(7, e.RowIndex).Value.ToString
  450. If Strings.Left(採購單號_tb.Text, 3) = "HXI" Then : 選擇公司_cb.Text = "PT HONG XHE INDUSTRIAL"
  451. ElseIf Strings.Left(採購單號_tb.Text, 3) = "PGS" Then : 選擇公司_cb.Text = "PT PUNCAK GEMILANG SEMESTA" : End If
  452. 簽名檔1_pb.Image = Nothing
  453. 供應商編碼_tb.Text = 已作廢_dgv(1, e.RowIndex).Value.ToString : conn.Close()
  454. PA = 供應商編碼_tb.Text : SQL_建築物料採購單生成_供應商資料一()
  455. If dr.Read() Then : 廠商_cb.Text = dr("公司名") : conn.Close() : End If : conn.Close()
  456. 驗證碼_tb.Text = 已作廢_dgv(11, e.RowIndex).Value.ToString : 圖片編碼_tb.Text = 已作廢_dgv(10, e.RowIndex).Value.ToString
  457. 使用地點_tb.Text = 已作廢_dgv(3, e.RowIndex).Value.ToString : 需求日期_dtp.Value = 已作廢_dgv(2, e.RowIndex).Value
  458. Set_清單()
  459. End If
  460. End Sub
  461. Private Sub 廠商_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 廠商_cb.SelectedIndexChanged
  462. PA1 = 廠商_cb.Text : SQL_建築物料採購單生成_供應商資料二()
  463. If dr.Read() Then
  464. 供應商編碼_tb.Text = dr("供應商編碼") : 地址_tb.Text = dr("公司地址") : 電話_tb.Text = dr("公司電話1") : 郵件_tb.Text = dr("聯繫人1郵箱") : 傳真_tb.Text = dr("公司傳真1")
  465. End If
  466. conn.Close()
  467. End Sub
  468. Private Sub 圖片編碼_tb_TextChanged(sender As Object, e As EventArgs) Handles 圖片編碼_tb.TextChanged
  469. PA1 = 圖片編碼_tb.Text : SQL_主管簽名檔管理_圖片流水號()
  470. 簽名檔2_pb.Image = Nothing
  471. While dr.Read() = True
  472. Dim unused As Byte() = New Byte(-1) {}
  473. Dim bytes As Byte() = DirectCast(dr.Item("簽名檔圖片"), Byte())
  474. Dim oStream As New MemoryStream(bytes)
  475. 簽名檔2_pb.Image = Bitmap.FromStream(oStream)
  476. End While
  477. conn.Close() : 簽名檔2_pb.SizeMode = 4
  478. End Sub
  479. Private Sub 小間距1_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 小間距1_ch.Click
  480. 小間距1_ch.Checked = True : 中間距1_ch.Checked = False : 大間距1_ch.Checked = False : Set_清單()
  481. End Sub
  482. Private Sub 中間距1_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 中間距1_ch.Click
  483. 小間距1_ch.Checked = False : 中間距1_ch.Checked = True : 大間距1_ch.Checked = False : Set_清單()
  484. End Sub
  485. Private Sub 大間距1_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 大間距1_ch.Click
  486. 小間距1_ch.Checked = False : 中間距1_ch.Checked = False : 大間距1_ch.Checked = True : Set_清單()
  487. End Sub
  488. Private Sub 物料圖檔_pb_Click(sender As Object, e As EventArgs) Handles 物料圖檔_pb.Click
  489. If IsNothing(物料圖檔_pb.Image) = False Then : 圖片傳遞 = 物料圖檔_pb.Image : 圖片放大視窗.ShowDialog() : End If
  490. End Sub
  491. Private Sub 詳細資料2_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 詳細資料2_ch.Click
  492. If 詳細資料2_ch.Checked = True Then : 詳細資料2_ch.Checked = True : Else : 詳細資料2_ch.Checked = False : End If : Set_清單()
  493. End Sub
  494. Private Sub 選擇公司_cb_Click(sender As Object, e As EventArgs) Handles 選擇公司_cb.Click
  495. CB選擇清單(選擇公司_cb, 選擇公司_cb.Text)
  496. End Sub
  497. Private Sub 廠商_cb_Click(sender As Object, e As EventArgs) Handles 廠商_cb.Click
  498. CB選擇清單(廠商_cb, 廠商_cb.Text)
  499. End Sub
  500. Private Sub 系統語言_cb_Click(sender As Object, e As EventArgs) Handles 系統語言_cb.Click
  501. CB選擇清單(系統語言_cb, 系統語言_cb.Text)
  502. End Sub
  503. Private Sub 打開清單_bt_Click(sender As Object, e As EventArgs) Handles 打開清單_bt.Click
  504. 打開清單()
  505. End Sub
  506. Private Sub 轉財務單_Click(sender As Object, e As EventArgs) Handles 轉財務單.Click
  507. PA25 = 0 : PA26 = 對話框(2) & " " & 廠商_cb.Text & " " & 對話框(3) : 財物支付單申請_傳票.內容_tb.Text = ""
  508. Dim XA As Integer = 0 : Dim 可以轉 As Boolean = False
  509. For i As Integer = 0 To 已核准_dgv.Rows.Count - 1
  510. If 已核准_dgv.Rows(i).Cells(22).Value <> 0 Then : PA25 = CLng(PA25) + 已核准_dgv.Rows(i).Cells(22).Value : 可以轉 = True
  511. If XA = 0 Then : PA26 &= 已核准_dgv.Rows(i).Cells(0).Value : Else : PA26 &= "、" & 已核准_dgv.Rows(i).Cells(0).Value : End If : XA += 1
  512. End If
  513. Next
  514. If 可以轉 = True Then
  515. If 財物支付單申請_傳票.Visible = True Then : Else : 跨部門開啟 = False : 財物支付單申請_傳票.Show() : End If
  516. If CLng(PA25) < 100000000000000 Then
  517. 財物支付單申請_傳票.申請金額_nud.Value = PA25 : 財物支付單申請_傳票.內容_tb.Text = PA26 : 財物支付單申請_傳票.編號1_cb.Text = "B-02"
  518. 財物支付單申請_傳票.編號2_cb.Text = "B-02-01" : 財物支付單申請_傳票.編號3_cb.Text = "B-02-01-02"
  519. PA48 = "採購"
  520. Else : MGB(對話框(1), 1) : 首次開啟 = False : End If
  521. End If : PA25 = "" : PA26 = "" : 財物支付單申請_傳票.BringToFront()
  522. End Sub
  523. Private Sub 全部資料_cb_Click(sender As Object, e As EventArgs) Handles 全部資料_cb.Click
  524. Set_清單1()
  525. End Sub
  526. Private Sub 確認列印_bt_Click_1(sender As Object, e As EventArgs) Handles 確認列印_bt.Click
  527. If 採購人員_tb.Text = "" Then
  528. SQL_物料採購單_首次列印() : 採購人員_tb.Text = gUserName : 採購日期_tb.Text = Today()
  529. End If
  530. Dim ds6 As New DataSet : 請購資料_dgv.DataSource = Nothing : ds6.Clear()
  531. 請購資料_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  532. 請購資料_dgv.ColumnHeadersHeight = 25 : 請購資料_dgv.AllowUserToAddRows = False
  533. PA38 = 採購單號_tb.Text : SQL_採購資料() : da.Fill(ds6) : 請購資料_dgv.DataSource = ds6.Tables(0) : conn.Close()
  534. xlApp = CType(CreateObject("Excel.Application"), Application) : xlBook = xlApp.Workbooks.Add : xlApp.DisplayAlerts = True : xlBook.Activate()
  535. xlSheet = NewMethod(xlBook) : xlSheet.Activate() : xlApp.Visible = True : xlApp.Application.WindowState = xlMaximized
  536. N1 = 0 : N2 = 0
  537. 'xlSheet.Cells(2, 1) = 選擇公司_cb.Text
  538. xlSheet.Cells(3, 1) = "PURCHASE ORDER"
  539. xlSheet.Cells(5, 1) = "ORDER TO : " & 廠商_cb.Text : xlSheet.Cells(6, 1) = "ALAMAT : " & 地址_tb.Text : xlSheet.Cells(7, 1) = "Telp : " & 電話_tb.Text
  540. xlSheet.Cells(8, 1) = "Fax : " & 傳真_tb.Text : xlSheet.Cells(9, 1) = "Email : " & 郵件_tb.Text
  541. xlSheet.Cells(10, 1) = "No." : xlSheet.Cells(10, 2) = "Nama produk" : xlSheet.Cells(10, 3) = "Spesifikasi" : xlSheet.Cells(10, 4) = "Komentar" : xlSheet.Cells(10, 5) = "SATUAN"
  542. xlSheet.Cells(10, 6) = "QTY" : xlSheet.Cells(10, 7) = "UNIT PRICE" : xlSheet.Cells(10, 8) = "TOTAL PRICE"
  543. xlSheet.Cells(5, 5) = "PO NOMOR 1 : " : xlSheet.Cells(5, 7) = 手動號碼_tb.Text
  544. xlSheet.Cells(7, 5) = "PO NOMOR 2 : " : xlSheet.Cells(7, 7) = 採購單號_tb.Text
  545. xlSheet.Cells(8, 5) = "TGL/BLN/THN : " : xlSheet.Cells(8, 7) = 需求日期_dtp.Value
  546. xlSheet.Cells(9, 5) = "TEMPAT PEMAKAIAN : " : xlSheet.Cells(9, 7) = 使用地點_tb.Text
  547. Dim GGHH As Integer = 0
  548. For i As Integer = 0 To 明細1_dgv.Rows.Count - 1
  549. xlSheet.Cells(i + 11, 1) = 明細1_dgv.Rows(i).Cells(表頭(2)).Value : xlSheet.Cells(i + 11, 2) = 明細1_dgv.Rows(i).Cells(表頭(12)).Value
  550. xlSheet.Cells(i + 11, 3) = 明細1_dgv.Rows(i).Cells(表頭(13)).Value : xlSheet.Cells(i + 11, 4) = 明細1_dgv.Rows(i).Cells(表頭(14)).Value
  551. xlSheet.Cells(i + 11, 5) = 明細1_dgv.Rows(i).Cells(表頭(16)).Value : xlSheet.Cells(i + 11, 6) = 明細1_dgv.Rows(i).Cells(表頭(15)).Value
  552. xlSheet.Cells(i + 11, 7) = 明細1_dgv.Rows(i).Cells(表頭(26)).Value : xlSheet.Cells(i + 11, 8) = 明細1_dgv.Rows(i).Cells(表頭(27)).Value
  553. GGHH += 明細1_dgv.Rows(i).Cells(表頭(27)).Value
  554. N1 = i + 11
  555. Next i
  556. xlSheet.Cells(N1 + 2, 7) = "TOTAL :" : xlSheet.Cells(N1 + 2, 8) = GGHH
  557. xlSheet.Cells(N1 + 3, 7) = "DISC " & 折扣比_tb.Text & "% :" : xlSheet.Cells(N1 + 3, 8) = 折扣金額_tb.Text
  558. xlSheet.Cells(N1 + 4, 7) = "PPN " & 稅金比_tb.Text & "% :" : xlSheet.Cells(N1 + 4, 8) = 稅金金額_tb.Text
  559. xlSheet.Cells(N1 + 5, 7) = "GRAND TOTAL :" : xlSheet.Cells(N1 + 5, 8) = 總金額_tb.Text
  560. xlSheet.Cells(N1 + 6, 1) = "Bagian Pembelian Barang" : xlSheet.Cells(N1 + 8, 1) = 採購人員_tb.Text : xlSheet.Cells(N1 + 9, 1) = 採購日期_tb.Text
  561. xlSheet.Cells(N1 + 6, 3) = "Direktur Utama" : xlSheet.Cells(N1 + 9, 3) = 審核日期2_tb.Text
  562. xlSheet.Cells(N1 + 6, 4) = "Bagian Pemeriksa" : xlSheet.Cells(N1 + 9, 4) = 審核日期1_tb.Text
  563. xlSheet.Cells(N1 + 6, 6) = "Bagian Pengisian Harga" : xlSheet.Cells(N1 + 8, 6) = 詢價員_tb.Text : xlSheet.Cells(N1 + 9, 6) = 尋價日期_tb.Text
  564. xlSheet.Cells(N1 + 6, 8) = "Asisten Proyek" : xlSheet.Cells(N1 + 8, 8) = 核對員_tb.Text : xlSheet.Cells(N1 + 9, 8) = 核對日期_tb.Text
  565. For i As Integer = 0 To 請購資料_dgv.Rows.Count - 1
  566. xlSheet.Cells(i + N1 + 12, 1) = 請購資料_dgv.Rows(i).Cells(0).Value
  567. If 系統語言 = "繁體中文" Then
  568. xlSheet.Cells(i + N1 + 12, 3) = 請購資料_dgv.Rows(i).Cells(2).Value
  569. Else
  570. xlSheet.Cells(i + N1 + 12, 3) = 請購資料_dgv.Rows(i).Cells(1).Value
  571. End If
  572. xlSheet.Cells(i + N1 + 12, 8) = 請購資料_dgv.Rows(i).Cells(3).Value : N2 += 1
  573. Next : AA(xlApp, xlSheet) : DD(xlApp, xlSheet) : EE(xlApp, xlSheet) : CC(xlApp, xlSheet) : FF(xlApp, xlSheet)
  574. If Strings.Left(採購單號_tb.Text, 2) = "HX" Then : GG(xlApp, xlSheet) : Else : HH(xlApp, xlSheet) : End If
  575. '-------------轉換成PDF---------------------------------------------------------------------
  576. Dim SERT As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
  577. xlBook.Sheets(1).ExportAsFixedFormat(XlFixedFormatType.xlTypePDF, SERT & "\" & 採購單號_tb.Text & "_PO(採購單).pdf", XlFixedFormatQuality.xlQualityStandard, True)
  578. '-------------關閉EXCEL---------------------------------------------------------------------
  579. xlSheet.PageSetup.PrintArea = "" : xlApp.Cells.Select()
  580. xlApp.Application.WindowState = xlMinimized
  581. xlBook.Close(False)
  582. Runtime.InteropServices.Marshal.ReleaseComObject(xlSheet)
  583. Runtime.InteropServices.Marshal.ReleaseComObject(xlBook)
  584. Runtime.InteropServices.Marshal.ReleaseComObject(xlApp)
  585. xlApp.Quit() : xlSheet = Nothing : xlBook = Nothing : xlApp = Nothing : GC.Collect()
  586. MGB(對話框(0), 1) : 首次開啟 = False
  587. End Sub
  588. Private Shared Function NewMethod(xlBook As Workbook) As Worksheet
  589. Return CType(xlBook.Worksheets.Add, Worksheet)
  590. End Function
  591. Private Sub AA(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  592. xlSheet.Cells.Select()
  593. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 12 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  594. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  595. xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 6 : xlSheet.Columns("B:B").Select : myExcel.Selection.ColumnWidth = 24
  596. xlSheet.Columns("C:C").Select : myExcel.Selection.ColumnWidth = 35 : xlSheet.Columns("D:D").Select : myExcel.Selection.ColumnWidth = 20
  597. xlSheet.Columns("E:E").Select : myExcel.Selection.ColumnWidth = 10 : xlSheet.Columns("F:F").Select : myExcel.Selection.ColumnWidth = 15
  598. xlSheet.Columns("G:G").Select : myExcel.Selection.ColumnWidth = 15 : xlSheet.Columns("H:H").Select : myExcel.Selection.ColumnWidth = 30
  599. xlSheet.Rows("1:1").Select : myExcel.Selection.RowHeight = 90 : xlSheet.Rows("2:2").Select : myExcel.Selection.RowHeight = 5
  600. xlSheet.Rows("3:3").Select : myExcel.Selection.RowHeight = 25 : xlSheet.Rows("4:4").Select : myExcel.Selection.RowHeight = 5
  601. xlSheet.Rows("5:9").Select : myExcel.Selection.RowHeight = 20 : xlSheet.Rows("10:10").Select : myExcel.Selection.RowHeight = 20
  602. xlSheet.Rows("11:" & N1).Select : myExcel.Selection.RowHeight = 65 : xlSheet.Rows(N1 + 1 & ":" & N1 + 1).Select : myExcel.Selection.RowHeight = 5
  603. xlSheet.Rows(N1 + 2 & ":" & N1 + 5).Select : myExcel.Selection.RowHeight = 17 : xlSheet.Rows(N1 + 6 & ":" & N1 + 6).Select : myExcel.Selection.RowHeight = 35
  604. xlSheet.Rows(N1 + 7 & ":" & N1 + 9).Select : myExcel.Selection.RowHeight = 35
  605. xlSheet.Range("A2:H2").Select()
  606. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  607. .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  608. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 26 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  609. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  610. xlSheet.Range("A3:H3").Select()
  611. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  612. .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  613. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 16 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  614. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  615. xlSheet.Range("A10:H" & N1).Select()
  616. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  617. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  618. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  619. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  620. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  621. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  622. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  623. xlSheet.Range("A" & N1 + 2 & ":H" & N1 + 2).Select()
  624. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  625. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  626. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  627. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  628. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  629. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  630. xlSheet.Range("A" & N1 + 3 & ":H" & N1 + 3).Select()
  631. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  632. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  633. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  634. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  635. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  636. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  637. xlSheet.Range("A" & N1 + 4 & ":H" & N1 + 4).Select()
  638. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  639. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  640. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  641. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  642. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  643. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  644. xlSheet.Range("A" & N1 + 5 & ":H" & N1 + 5).Select()
  645. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  646. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  647. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  648. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  649. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  650. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  651. xlSheet.Range("A" & N1 + 6 & ":B" & N1 + 6).Select()
  652. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  653. .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  654. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  655. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  656. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  657. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  658. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  659. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  660. xlSheet.Range("C" & N1 + 6 & ":C" & N1 + 6).Select()
  661. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  662. .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  663. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  664. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  665. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  666. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  667. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  668. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  669. xlSheet.Range("D" & N1 + 6 & ":E" & N1 + 6).Select()
  670. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  671. .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  672. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  673. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  674. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  675. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  676. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  677. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  678. xlSheet.Range("F" & N1 + 6 & ":G" & N1 + 6).Select()
  679. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  680. .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  681. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  682. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  683. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  684. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  685. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  686. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  687. xlSheet.Range("H" & N1 + 6).Select()
  688. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  689. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  690. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  691. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  692. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  693. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  694. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  695. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  696. xlSheet.Range("A" & N1 + 7 & ":B" & N1 + 9).Select()
  697. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  698. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  699. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  700. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  701. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  702. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  703. xlSheet.Range("C" & N1 + 7 & ":C" & N1 + 9).Select()
  704. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  705. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  706. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  707. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  708. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  709. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  710. xlSheet.Range("D" & N1 + 7 & ":E" & N1 + 9).Select()
  711. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  712. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  713. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  714. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  715. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  716. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  717. xlSheet.Range("F" & N1 + 7 & ":G" & N1 + 9).Select()
  718. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  719. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  720. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  721. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  722. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  723. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  724. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  725. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  726. xlSheet.Range("H" & N1 + 7 & ":H" & N1 + 9).Select()
  727. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  728. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  729. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  730. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  731. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  732. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  733. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  734. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  735. xlSheet.Range("A10:A" & N1).Select()
  736. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  737. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  738. xlSheet.Range("B11:D" & N1).Select()
  739. With myExcel.Selection
  740. .HorizontalAlignment = xlGeneral : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  741. .ReadingOrder = xlContext : .MergeCells = False : End With
  742. xlSheet.Range("E11:F" & N1).Select()
  743. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  744. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  745. xlSheet.Range("G11:H" & N1).Select() : myExcel.Selection.NumberFormatLocal = "#,##0"
  746. xlSheet.Range("H" & N1 + 2).Select() : myExcel.Selection.NumberFormatLocal = "#,##0"
  747. xlSheet.Range("H" & N1 + 2 & ":H" & N1 + 5).Select()
  748. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  749. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  750. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  751. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  752. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  753. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  754. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  755. myExcel.ActiveWindow.DisplayGridlines = False
  756. xlSheet.Range("A3:H3").Select()
  757. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  758. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  759. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  760. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  761. xlSheet.Range("G7:G9").Select()
  762. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  763. .ReadingOrder = xlContext : .MergeCells = False : End With
  764. xlSheet.Range("A10:H" & N1).Select()
  765. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  766. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  767. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  768. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  769. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  770. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  771. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  772. xlSheet.Range("A" & N1 + 2 & ":H" & N1 + 5).Select()
  773. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  774. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  775. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  776. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  777. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  778. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  779. xlSheet.Range("A" & N1 + 6 & ":B" & N1 + 9).Select()
  780. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  781. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  782. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  783. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  784. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  785. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  786. xlSheet.Range("C" & N1 + 6 & ":C" & N1 + 9).Select()
  787. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  788. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  789. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  790. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  791. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  792. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  793. xlSheet.Range("D" & N1 + 6 & ":E" & N1 + 9).Select()
  794. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  795. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  796. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  797. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  798. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  799. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  800. xlSheet.Range("F" & N1 + 6 & ":G" & N1 + 9).Select()
  801. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  802. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  803. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  804. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  805. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  806. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  807. xlSheet.Range("H" & N1 + 6 & ":H" & N1 + 9).Select()
  808. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  809. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  810. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  811. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  812. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  813. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  814. xlSheet.Rows("5:9").Select
  815. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 10 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  816. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  817. xlSheet.Rows("11:" & N1).Select
  818. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 10 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  819. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  820. xlSheet.Range("A10:H10").Select()
  821. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  822. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  823. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  824. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  825. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  826. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  827. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  828. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  829. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  830. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  831. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  832. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  833. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  834. xlSheet.Range("A11:H" & N1).Select()
  835. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  836. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  837. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  838. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  839. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  840. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  841. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  842. xlSheet.Range("B11:D" & N1).Select()
  843. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  844. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  845. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  846. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  847. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  848. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  849. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  850. xlSheet.Range("F11:F" & N1).Select()
  851. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  852. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  853. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  854. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  855. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  856. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  857. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  858. xlSheet.Range("H11:H" & N1).Select()
  859. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  860. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  861. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  862. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  863. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  864. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  865. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  866. xlSheet.Range("A" & N1 + 2 & ":H" & N1 + 5).Select()
  867. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  868. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  869. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  870. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  871. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  872. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  873. xlSheet.Range("H" & N1 + 2 & ":H" & N1 + 5).Select()
  874. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  875. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  876. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  877. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  878. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  879. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  880. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  881. xlSheet.Range("G" & N1 + 2 & ":G" & N1 + 5).Select()
  882. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  883. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  884. xlSheet.Range("F" & N1 + 8 & ":G" & N1 + 8).Select()
  885. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  886. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  887. xlSheet.Range("F" & N1 + 9 & ":G" & N1 + 9).Select()
  888. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  889. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  890. xlSheet.Range("A" & N1 + 8 & ":B" & N1 + 8).Select()
  891. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  892. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  893. xlSheet.Range("A" & N1 + 9 & ":B" & N1 + 9).Select()
  894. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  895. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  896. xlSheet.Range("C" & N1 + 9).Select()
  897. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  898. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  899. xlSheet.Range("A" & N1 + 11 & ":H" & N1 + N2 + 11).Select()
  900. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  901. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  902. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  903. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  904. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  905. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  906. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  907. myExcel.Application.PrintCommunication = False
  908. With myExcel.ActiveSheet.PageSetup : .PrintTitleRows = "$1:$10" : .PrintTitleColumns = "" : End With
  909. myExcel.Application.PrintCommunication = True : myExcel.ActiveSheet.PageSetup.PrintArea = "" : myExcel.Application.PrintCommunication = False
  910. With myExcel.ActiveSheet.PageSetup : .LeftHeader = "" : .CenterHeader = "" : .RightHeader = "" : .LeftFooter = "" : .CenterFooter = "第 &P 頁,共 &N 頁" : .RightFooter = ""
  911. .LeftMargin = myExcel.Application.InchesToPoints(0.236220472440945) : .RightMargin = myExcel.Application.InchesToPoints(0.236220472440945)
  912. .TopMargin = myExcel.Application.InchesToPoints(0.748031496062992) : .BottomMargin = myExcel.Application.InchesToPoints(0.748031496062992)
  913. .HeaderMargin = myExcel.Application.InchesToPoints(0.31496062992126) : .FooterMargin = myExcel.Application.InchesToPoints(0.31496062992126)
  914. .PrintHeadings = False : .PrintGridlines = False : .PrintQuality = 600 : .CenterHorizontally = False : .CenterVertically = False : .Draft = False
  915. .FirstPageNumber = xlAutomatic : .BlackAndWhite = False : .Zoom = False : .FitToPagesWide = 1 : .FitToPagesTall = False : .OddAndEvenPagesHeaderFooter = False
  916. .DifferentFirstPageHeaderFooter = False : .ScaleWithDocHeaderFooter = True : .AlignMarginsHeaderFooter = True : .EvenPage.LeftHeader.Text = ""
  917. .EvenPage.CenterHeader.Text = "" : .EvenPage.RightHeader.Text = "" : .EvenPage.LeftFooter.Text = "" : .EvenPage.CenterFooter.Text = ""
  918. .EvenPage.RightFooter.Text = "" : .FirstPage.LeftHeader.Text = "" : .FirstPage.CenterHeader.Text = "" : .FirstPage.RightHeader.Text = ""
  919. .FirstPage.LeftFooter.Text = "" : .FirstPage.CenterFooter.Text = "" : .FirstPage.RightFooter.Text = ""
  920. End With : myExcel.Application.PrintCommunication = True
  921. End Sub
  922. Private Sub CC(ByVal myExcel As Application, ByVal xlSheet As Microsoft.Office.Interop.Excel.Worksheet)
  923. Clipboard.SetDataObject(簽名檔2_pb.Image)
  924. xlSheet.Range("C" & N1 + 8).Select()
  925. myExcel.ActiveSheet.Pictures.Paste.Select
  926. myExcel.Selection.ShapeRange.Height = 50
  927. myExcel.Selection.ShapeRange.IncrementLeft(10)
  928. myExcel.Selection.ShapeRange.IncrementTop(-23)
  929. End Sub
  930. Private Sub DD(ByVal myExcel As Application, ByVal xlSheet As Microsoft.Office.Interop.Excel.Worksheet)
  931. Clipboard.SetDataObject(QRCode_pb.Image)
  932. xlSheet.Range("H5").Select()
  933. myExcel.ActiveSheet.Pictures.Paste.Select
  934. myExcel.Selection.ShapeRange.Height = 90
  935. myExcel.Selection.ShapeRange.IncrementLeft(70)
  936. myExcel.Selection.ShapeRange.IncrementTop(1)
  937. End Sub
  938. Private Sub EE(ByVal myExcel As Application, ByVal xlSheet As Microsoft.Office.Interop.Excel.Worksheet)
  939. Clipboard.SetDataObject(簽名檔1_pb.Image)
  940. xlSheet.Range("D" & N1 + 8).Select()
  941. myExcel.ActiveSheet.Pictures.Paste.Select
  942. myExcel.Selection.ShapeRange.Height = 50
  943. myExcel.Selection.ShapeRange.IncrementLeft(10)
  944. myExcel.Selection.ShapeRange.IncrementTop(-23)
  945. End Sub
  946. Private Sub GG(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Worksheet)
  947. Clipboard.SetDataObject(財物支付單申請_傳票.PictureBox1.Image)
  948. xlSheet.Range("A1").Select()
  949. myExcel.ActiveSheet.Pictures.Paste.Select
  950. myExcel.Selection.ShapeRange.Height = 93
  951. myExcel.Selection.ShapeRange.IncrementLeft(50)
  952. myExcel.Selection.ShapeRange.IncrementTop(0)
  953. End Sub
  954. Private Sub HH(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Worksheet)
  955. Clipboard.SetDataObject(財物支付單申請_傳票.PictureBox2.Image)
  956. xlSheet.Range("A1").Select()
  957. myExcel.ActiveSheet.Pictures.Paste.Select
  958. myExcel.Selection.ShapeRange.Height = 93
  959. myExcel.Selection.ShapeRange.IncrementLeft(50)
  960. myExcel.Selection.ShapeRange.IncrementTop(0)
  961. End Sub
  962. Private Sub FF(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  963. myExcel.Application.PrintCommunication = False
  964. With myExcel.ActiveSheet.PageSetup : .PrintTitleRows = "$1:$11" : .PrintTitleColumns = "" : End With
  965. myExcel.Application.PrintCommunication = True : myExcel.ActiveSheet.PageSetup.PrintArea = "" : myExcel.Application.PrintCommunication = False
  966. With myExcel.ActiveSheet.PageSetup : .LeftHeader = "" : .CenterHeader = "" : .RightHeader = "" : .LeftFooter = "" : .CenterFooter = "第 &P 頁,共 &N 頁" : .RightFooter = ""
  967. .LeftMargin = myExcel.Application.InchesToPoints(0.236220472440945) : .RightMargin = myExcel.Application.InchesToPoints(0.236220472440945)
  968. .TopMargin = myExcel.Application.InchesToPoints(0.748031496062992) : .BottomMargin = myExcel.Application.InchesToPoints(0.748031496062992)
  969. .HeaderMargin = myExcel.Application.InchesToPoints(0.31496062992126) : .FooterMargin = myExcel.Application.InchesToPoints(0.31496062992126)
  970. .PrintHeadings = False : .PrintGridlines = False : .PrintQuality = 600 : .CenterHorizontally = False : .CenterVertically = False : .Draft = False
  971. .FirstPageNumber = xlAutomatic : .BlackAndWhite = False : .Zoom = False : .FitToPagesWide = 1 : .FitToPagesTall = False : .OddAndEvenPagesHeaderFooter = False
  972. .DifferentFirstPageHeaderFooter = False : .ScaleWithDocHeaderFooter = True : .AlignMarginsHeaderFooter = True : .EvenPage.LeftHeader.Text = ""
  973. .EvenPage.CenterHeader.Text = "" : .EvenPage.RightHeader.Text = "" : .EvenPage.LeftFooter.Text = "" : .EvenPage.CenterFooter.Text = ""
  974. .EvenPage.RightFooter.Text = "" : .FirstPage.LeftHeader.Text = "" : .FirstPage.CenterHeader.Text = "" : .FirstPage.RightHeader.Text = ""
  975. .FirstPage.LeftFooter.Text = "" : .FirstPage.CenterFooter.Text = "" : .FirstPage.RightFooter.Text = ""
  976. End With : myExcel.Application.PrintCommunication = True
  977. End Sub
  978. '-----------------------------滑鼠右鍵--------------------------------------------------------------------------------------------------------------------------------------
  979. Private Sub 重新整理SegarkanToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 重新整理_tsm.Click
  980. Set_清單1() : Set_清單2()
  981. End Sub
  982. Private Sub 風格()
  983. If 深色風格 = False Then
  984. Me.BackColor = SystemColors.Control
  985. 選擇公司_lb.ForeColor = Color.Blue
  986. 已核准_lb.ForeColor = Color.Black : 一級簽核_lb.ForeColor = Color.Black : 二級簽核_lb.ForeColor = Color.Black : Label1.ForeColor = Color.Black
  987. Label2.ForeColor = Color.Black : Label3.ForeColor = Color.Black : Label6.ForeColor = Color.Black : Label12.ForeColor = Color.Black
  988. Label11.ForeColor = Color.Black : Label8.ForeColor = Color.Black : Label5.ForeColor = Color.Black : Label7.ForeColor = Color.Black
  989. 總金額_lb.ForeColor = Color.Black : 詳細資料2_ch.ForeColor = Color.Black : 小間距1_ch.ForeColor = Color.Black : 中間距1_ch.ForeColor = Color.Black
  990. 大間距1_ch.ForeColor = Color.Black : 稅金計算_ch.ForeColor = Color.Black : Label9.ForeColor = Color.Black
  991. 語轉扭_bt.BackColor = Color.White : 語轉扭_bt.ForeColor = Color.Black
  992. 地址_tb.BackColor = Color.White : 地址_tb.ForeColor = Color.Black : 電話_tb.BackColor = Color.White : 電話_tb.ForeColor = Color.Black
  993. 採購單號_tb.BackColor = Color.White : 採購單號_tb.ForeColor = Color.Black : 折扣比_tb.BackColor = Color.White : 折扣比_tb.ForeColor = Color.Black
  994. 折扣金額_tb.BackColor = Color.White : 折扣金額_tb.ForeColor = Color.Black : 傳真_tb.BackColor = Color.White : 傳真_tb.ForeColor = Color.Black
  995. 稅金比_tb.BackColor = Color.White : 稅金比_tb.ForeColor = Color.Black : 稅金金額_tb.BackColor = Color.White : 稅金金額_tb.ForeColor = Color.Black
  996. 郵件_tb.BackColor = Color.White : 郵件_tb.ForeColor = Color.Black : 使用地點_tb.BackColor = Color.White : 使用地點_tb.ForeColor = Color.Black
  997. 總金額_tb.BackColor = Color.White : 總金額_tb.ForeColor = Color.Black
  998. 選擇公司_cb.BackColor = Color.White : 選擇公司_cb.ForeColor = Color.Black : 廠商_cb.BackColor = Color.White : 廠商_cb.ForeColor = Color.Black
  999. 系統語言_cb.BackColor = Color.White : 系統語言_cb.ForeColor = Color.Black : 手動號碼_tb.BackColor = Color.White : 手動號碼_tb.ForeColor = Color.Black
  1000. 確認列印_bt.BackColor = Color.White
  1001. 已核准_dgv.EnableHeadersVisualStyles = True : 已核准_dgv.BackgroundColor = Color.White : 已核准_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.Black
  1002. 已核准_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.LightPink
  1003. 已核准_dgv.DefaultCellStyle.BackColor = Color.White : 已核准_dgv.DefaultCellStyle.ForeColor = Color.Black
  1004. 明細_dgv.EnableHeadersVisualStyles = True : 明細_dgv.BackgroundColor = Color.White : 明細_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.Black
  1005. 明細_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.LightBlue
  1006. 明細_dgv.DefaultCellStyle.BackColor = Color.White : 明細_dgv.DefaultCellStyle.ForeColor = Color.Black
  1007. Else
  1008. Me.BackColor = Color.Black
  1009. 選擇公司_lb.ForeColor = Color.LightBlue
  1010. 已核准_lb.ForeColor = Color.White : 一級簽核_lb.ForeColor = Color.White : 二級簽核_lb.ForeColor = Color.White : Label1.ForeColor = Color.White
  1011. Label2.ForeColor = Color.White : Label3.ForeColor = Color.White : Label6.ForeColor = Color.White : Label12.ForeColor = Color.White
  1012. Label11.ForeColor = Color.White : Label8.ForeColor = Color.White : Label5.ForeColor = Color.White : Label7.ForeColor = Color.White
  1013. 總金額_lb.ForeColor = Color.White : 詳細資料2_ch.ForeColor = Color.White : 小間距1_ch.ForeColor = Color.White : 中間距1_ch.ForeColor = Color.White
  1014. 大間距1_ch.ForeColor = Color.White : 稅金計算_ch.ForeColor = Color.White : Label9.ForeColor = Color.White
  1015. 語轉扭_bt.BackColor = Color.DimGray : 語轉扭_bt.ForeColor = Color.White
  1016. 地址_tb.BackColor = Color.DimGray : 地址_tb.ForeColor = Color.White : 電話_tb.BackColor = Color.DimGray : 電話_tb.ForeColor = Color.White
  1017. 採購單號_tb.BackColor = Color.DimGray : 採購單號_tb.ForeColor = Color.White : 折扣比_tb.BackColor = Color.DimGray : 折扣比_tb.ForeColor = Color.White
  1018. 折扣金額_tb.BackColor = Color.DimGray : 折扣金額_tb.ForeColor = Color.White : 傳真_tb.BackColor = Color.DimGray : 傳真_tb.ForeColor = Color.White
  1019. 稅金比_tb.BackColor = Color.DimGray : 稅金比_tb.ForeColor = Color.White : 稅金金額_tb.BackColor = Color.DimGray : 稅金金額_tb.ForeColor = Color.White
  1020. 郵件_tb.BackColor = Color.DimGray : 郵件_tb.ForeColor = Color.White : 使用地點_tb.BackColor = Color.DimGray : 使用地點_tb.ForeColor = Color.White
  1021. 總金額_tb.BackColor = Color.DimGray : 總金額_tb.ForeColor = Color.White
  1022. 選擇公司_cb.BackColor = Color.DimGray : 選擇公司_cb.ForeColor = Color.White : 廠商_cb.BackColor = Color.DimGray : 廠商_cb.ForeColor = Color.White
  1023. 系統語言_cb.BackColor = Color.DimGray : 系統語言_cb.ForeColor = Color.White : 手動號碼_tb.BackColor = Color.DimGray : 手動號碼_tb.ForeColor = Color.White
  1024. 確認列印_bt.BackColor = Color.DimGray
  1025. 已核准_dgv.EnableHeadersVisualStyles = False : 已核准_dgv.BackgroundColor = Color.DimGray : 已核准_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.White
  1026. 已核准_dgv.ColumnHeadersDefaultCellStyle.BackColor = Color.Black : 已核准_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.DimGray
  1027. 已核准_dgv.DefaultCellStyle.BackColor = Color.Black : 已核准_dgv.DefaultCellStyle.ForeColor = Color.White
  1028. 明細_dgv.EnableHeadersVisualStyles = False : 明細_dgv.BackgroundColor = Color.DimGray : 明細_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.White
  1029. 明細_dgv.ColumnHeadersDefaultCellStyle.BackColor = Color.Black : 明細_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.DimGray
  1030. 明細_dgv.DefaultCellStyle.BackColor = Color.Black : 明細_dgv.DefaultCellStyle.ForeColor = Color.White
  1031. End If
  1032. End Sub
  1033. End Class