Нет описания
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

列印_樣品單.vb 64KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
  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. Public Class 列印_樣品單
  12. Private ReadOnly ds, ds1, ds2, ds3 As New DataSet
  13. Dim N1, N2, N3, N4, N5, N6, N7, N8, N9, N10, N11, Q1 As Integer
  14. Dim xlApp As Microsoft.Office.Interop.Excel.Application
  15. Dim xlBook As Microsoft.Office.Interop.Excel.Workbook
  16. Dim xlSheet As Microsoft.Office.Interop.Excel.Worksheet
  17. Dim ww1, ww2 As Boolean
  18. Private Sub Set_清單()
  19. DataGridView1.DataSource = Nothing : ds.Clear()
  20. DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  21. DataGridView1.ColumnHeadersHeight = 25
  22. DataGridView1.AllowUserToAddRows = False
  23. ConnOpen()
  24. SQL1 = "SELECT SO, 季節, 客戶, 型體號碼, 型體名稱, 國家, 狀態, ISS_DATE, ETA, 數量, 制單人, LEFT(制單時間, 10) AS 制單時間, 版次, 工廠, REQ FROM 樣品訂單控制表 " &
  25. "WHERE SO LIKE N'" & 列印用SQL & "' AND 版次 LIKE N'" & 列印用SQL2 & "' ORDER BY SO DESC, 版次 DESC"
  26. CmdSet_For_DGV()
  27. da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close()
  28. End Sub
  29. Private Sub Set_清單2()
  30. DataGridView2.DataSource = Nothing : ds1.Clear()
  31. DataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  32. DataGridView2.ColumnHeadersHeight = 25
  33. DataGridView2.AllowUserToAddRows = False
  34. ConnOpen()
  35. SQL1 = "SELECT 項次, 顏色, 架號, 數量, SIZE, KEEP, 流水號, 版次, 備註, 借出者 FROM 樣品訂單清單 WHERE (SO LIKE N'" & 列印用SQL & "' AND 版次 LIKE N'" & 列印用SQL2 & "') ORDER BY 項次"
  36. CmdSet_For_DGV()
  37. da.Fill(ds1) : DataGridView2.DataSource = ds1.Tables(0) : conn.Close()
  38. End Sub
  39. Private Sub Set_清單3()
  40. DataGridView3.DataSource = Nothing : ds2.Clear()
  41. DataGridView3.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  42. DataGridView3.ColumnHeadersHeight = 25
  43. DataGridView3.AllowUserToAddRows = False
  44. ConnOpen()
  45. SQL1 = "SELECT LEFT(樣品訂單部件表.部件, 2) AS 部件, 部件大項分類.部件類別 FROM 樣品訂單部件表 LEFT OUTER JOIN 部件大項分類 ON LEFT(樣品訂單部件表.部件, 2) = LEFT(部件大項分類.部件類別, 2) " &
  46. "WHERE (樣品訂單部件表.SO LIKE N'" & 列印用SQL & "') AND (樣品訂單部件表.版次 LIKE N'" & 列印用SQL2 & "') GROUP BY LEFT(樣品訂單部件表.部件, 2), 部件大項分類.部件類別 ORDER BY 部件"
  47. CmdSet_For_DGV()
  48. da.Fill(ds2) : DataGridView3.DataSource = ds2.Tables(0) : conn.Close()
  49. End Sub
  50. Private Sub 列印_樣品單_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  51. FormBorderStyle = FormBorderStyle.SizableToolWindow : ControlBox = False
  52. Set_清單() : Set_清單2() : Set_清單3()
  53. DataGridView1.Visible = False : DataGridView2.Visible = False : DataGridView3.Visible = False : DataGridView4.Visible = False : PictureBox1.Visible = False
  54. End Sub
  55. Private Sub 列印1()
  56. xlSheet.Cells(1, 1) = "WTL ENTERPRISE CO., LTD." : xlSheet.Cells(1, 21) = "SAMPLE ORDER (樣品單)" : xlSheet.Cells(2, 1) = "11F-9., No.151, Sec. 2, Hankou Rd., Situn Dist., "
  57. xlSheet.Cells(3, 1) = "Taichung City, Taiwan 40746" : xlSheet.Cells(3, 24) = "PRINT DATE :" : xlSheet.Cells(3, 29) = "=TODAY()" : xlSheet.Cells(5, 1) = "S/O # (單號)"
  58. xlSheet.Cells(6, 1) = "CUST (客戶)" : xlSheet.Cells(7, 1) = "FACTORY (工廠)" : xlSheet.Cells(8, 1) = "STYLE # (型體號)" : xlSheet.Cells(9, 1) = "STY.NAME (型體名)"
  59. xlSheet.Cells(10, 1) = "COUNTRY (國家)" : xlSheet.Cells(11, 1) = "PURPOSE (目的)"
  60. xlSheet.Cells(5, 6) = ":" : xlSheet.Cells(6, 6) = ":" : xlSheet.Cells(7, 6) = ":" : xlSheet.Cells(8, 6) = ":" : xlSheet.Cells(9, 6) = ":" : xlSheet.Cells(10, 6) = ":" : xlSheet.Cells(11, 6) = ":"
  61. xlSheet.Cells(5, 14) = "EDITION (版次)" : xlSheet.Cells(6, 14) = "SEASON (季節)" : xlSheet.Cells(7, 14) = "ISS. DATE (制單日期)" : xlSheet.Cells(8, 14) = "ETD (預計寄出日期)"
  62. xlSheet.Cells(9, 14) = "REQ. BY" : xlSheet.Cells(10, 14) = "INVOICE" : xlSheet.Cells(11, 14) = "TOTAL (總數)"
  63. xlSheet.Cells(5, 19) = ":" : xlSheet.Cells(6, 19) = ":" : xlSheet.Cells(7, 19) = ":" : xlSheet.Cells(8, 19) = ":" : xlSheet.Cells(9, 19) = ":" : xlSheet.Cells(10, 19) = ":"
  64. xlSheet.Cells(11, 19) = ":"
  65. xlSheet.Cells(5, 7) = DataGridView1.Rows(0).Cells("SO").Value : xlSheet.Cells(6, 7) = DataGridView1.Rows(0).Cells("客戶").Value
  66. xlSheet.Cells(7, 7) = DataGridView1.Rows(0).Cells("工廠").Value : xlSheet.Cells(8, 7) = DataGridView1.Rows(0).Cells("型體號碼").Value
  67. xlSheet.Cells(9, 7) = DataGridView1.Rows(0).Cells("型體名稱").Value : xlSheet.Cells(10, 7) = DataGridView1.Rows(0).Cells("國家").Value
  68. xlSheet.Cells(11, 7) = DataGridView1.Rows(0).Cells("狀態").Value : xlSheet.Cells(5, 20) = DataGridView1.Rows(0).Cells("版次").Value
  69. xlSheet.Cells(6, 20) = DataGridView1.Rows(0).Cells("季節").Value : xlSheet.Cells(7, 20) = DataGridView1.Rows(0).Cells("ISS_DATE").Value
  70. xlSheet.Cells(8, 20) = DataGridView1.Rows(0).Cells("ETA").Value : xlSheet.Cells(9, 20) = DataGridView1.Rows(0).Cells("REQ").Value
  71. xlSheet.Cells(10, 20) = "" : xlSheet.Cells(11, 20) = DataGridView1.Rows(0).Cells("數量").Value
  72. AA(xlApp, xlSheet)
  73. PictureBox1.Image = Nothing
  74. ConnOpen()
  75. SQL1 = "SELECT TOP(1) 圖片 FROM 鞋型圖片資料庫 " &
  76. "WHERE 客戶 LIKE N'" & DataGridView1.Rows(0).Cells("客戶").Value & "' AND 形體號 LIKE N'" & DataGridView1.Rows(0).Cells("型體號碼").Value &
  77. "' AND 形體名 LIKE N'" & DataGridView1.Rows(0).Cells("型體名稱").Value & "' AND 類別 LIKE N'設計圖'"
  78. CmdSet_For_dr()
  79. If dr.Read() Then
  80. PictureBox1.Image = Nothing
  81. ConnOpen()
  82. SQL1 = "SELECT TOP(1) 圖片 FROM 鞋型圖片資料庫 " &
  83. "WHERE 客戶 LIKE N'" & DataGridView1.Rows(0).Cells("客戶").Value & "' AND 形體號 LIKE N'" & DataGridView1.Rows(0).Cells("型體號碼").Value &
  84. "' AND 形體名 LIKE N'" & DataGridView1.Rows(0).Cells("型體名稱").Value & "' AND 類別 LIKE N'設計圖'"
  85. CmdSet_For_dr()
  86. While dr.Read() = True
  87. Dim bytes As Byte() = New Byte(-1) {}
  88. bytes = DirectCast(dr.Item("圖片"), Byte())
  89. Dim oStream As New MemoryStream(bytes)
  90. PictureBox1.Image = Image.FromStream(oStream)
  91. End While
  92. conn.Close() : GG(xlApp, xlSheet)
  93. Else
  94. xlSheet.Cells(5, 28) = "系統中無圖片"
  95. conn.Close()
  96. End If : PictureBox1.SizeMode = 4
  97. N1 = 0 : N2 = 0 : N4 = 0 : N5 = 0 : N6 = -1 : N7 = -1 : N8 = 0
  98. End Sub
  99. Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click
  100. If CheckBox1.Checked = False And CheckBox2.Checked = False And CheckBox3.Checked = False Then
  101. MsgBox("沒有選擇顏色分配頁數")
  102. Else
  103. xlApp = CType(CreateObject("Excel.Application"), Microsoft.Office.Interop.Excel.Application)
  104. xlBook = xlApp.Workbooks.Add
  105. xlApp.DisplayAlerts = True
  106. xlApp.Visible = True
  107. xlApp.Application.WindowState = xlMaximized
  108. For i As Integer = 0 To DataGridView2.Rows.Count - 1
  109. If CheckBox1.Checked = True Then
  110. '三色一頁
  111. If i = 0 Then
  112. xlSheet = NewMethod(xlBook)
  113. If xlApp.Sheets(1).Name = "工作表2" Then
  114. xlApp.Sheets("工作表2").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第一頁"
  115. Else
  116. xlApp.Sheets("sheet2").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第一頁"
  117. End If
  118. xlBook.Activate() : xlSheet.Activate() : 列印1() : Q1 = 0
  119. ElseIf i = 3 Then
  120. FF(xlApp, xlSheet)
  121. xlSheet = NewMethod(xlBook)
  122. If xlApp.Sheets(1).Name = "工作表3" Then
  123. xlApp.Sheets("工作表3").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第二頁"
  124. Else
  125. xlApp.Sheets("sheet3").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第二頁"
  126. End If
  127. xlBook.Activate() : xlSheet.Activate() : 列印1() : Q1 = 0
  128. ElseIf i = 6 Then
  129. FF(xlApp, xlSheet)
  130. xlSheet = NewMethod(xlBook)
  131. If xlApp.Sheets(1).Name = "工作表4" Then
  132. xlApp.Sheets("工作表4").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第三頁"
  133. Else
  134. xlApp.Sheets("sheet4").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第三頁"
  135. End If
  136. xlBook.Activate() : xlSheet.Activate() : 列印1() : Q1 = 0
  137. ElseIf i = 9 Then
  138. FF(xlApp, xlSheet)
  139. xlSheet = NewMethod(xlBook)
  140. If xlApp.Sheets(1).Name = "工作表5" Then
  141. xlApp.Sheets("工作表5").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第四頁"
  142. Else
  143. xlApp.Sheets("sheet5").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第四頁"
  144. End If
  145. xlBook.Activate() : xlSheet.Activate() : 列印1() : Q1 = 0
  146. End If
  147. ElseIf CheckBox3.Checked = True Then
  148. '四色一頁
  149. If i = 0 Then
  150. xlSheet = NewMethod(xlBook)
  151. If xlApp.Sheets(1).Name = "工作表2" Then
  152. xlApp.Sheets("工作表2").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第一頁"
  153. Else
  154. xlApp.Sheets("sheet2").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第一頁"
  155. End If
  156. xlBook.Activate() : xlSheet.Activate() : 列印1() : Q1 = 0
  157. ElseIf i = 4 Then
  158. FF(xlApp, xlSheet)
  159. xlSheet = NewMethod(xlBook)
  160. If xlApp.Sheets(1).Name = "工作表3" Then
  161. xlApp.Sheets("工作表3").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第二頁"
  162. Else
  163. xlApp.Sheets("sheet3").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第二頁"
  164. End If
  165. xlBook.Activate() : xlSheet.Activate() : 列印1() : Q1 = 0
  166. ElseIf i = 8 Then
  167. FF(xlApp, xlSheet)
  168. xlSheet = NewMethod(xlBook)
  169. If xlApp.Sheets(1).Name = "工作表4" Then
  170. xlApp.Sheets("工作表4").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第三頁"
  171. Else
  172. xlApp.Sheets("sheet4").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第三頁"
  173. End If
  174. xlBook.Activate() : xlSheet.Activate() : 列印1() : Q1 = 0
  175. End If
  176. ElseIf CheckBox2.Checked = True Then
  177. '二色一頁
  178. If i = 0 Then
  179. xlSheet = NewMethod(xlBook)
  180. If xlApp.Sheets(1).Name = "工作表2" Then
  181. xlApp.Sheets("工作表2").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第一頁"
  182. Else
  183. xlApp.Sheets("sheet2").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第一頁"
  184. End If
  185. xlBook.Activate() : xlSheet.Activate() : 列印1() : Q1 = 0
  186. ElseIf i = 2 Then
  187. FF(xlApp, xlSheet)
  188. xlSheet = NewMethod(xlBook)
  189. If xlApp.Sheets(1).Name = "工作表3" Then
  190. xlApp.Sheets("工作表3").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第二頁"
  191. Else
  192. xlApp.Sheets("sheet3").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第二頁"
  193. End If
  194. xlBook.Activate() : xlSheet.Activate() : 列印1() : Q1 = 0
  195. ElseIf i = 4 Then
  196. FF(xlApp, xlSheet)
  197. xlSheet = NewMethod(xlBook)
  198. If xlApp.Sheets(1).Name = "工作表4" Then
  199. xlApp.Sheets("工作表4").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第三頁"
  200. Else
  201. xlApp.Sheets("sheet4").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第三頁"
  202. End If
  203. xlBook.Activate() : xlSheet.Activate() : 列印1() : Q1 = 0
  204. ElseIf i = 6 Then
  205. FF(xlApp, xlSheet)
  206. xlSheet = NewMethod(xlBook)
  207. If xlApp.Sheets(1).Name = "工作表5" Then
  208. xlApp.Sheets("工作表5").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第四頁"
  209. Else
  210. xlApp.Sheets("sheet5").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第四頁"
  211. End If
  212. xlBook.Activate() : xlSheet.Activate() : 列印1() : Q1 = 0
  213. ElseIf i = 8 Then
  214. FF(xlApp, xlSheet)
  215. xlSheet = NewMethod(xlBook)
  216. If xlApp.Sheets(1).Name = "工作表6" Then
  217. xlApp.Sheets("工作表6").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第五頁"
  218. Else
  219. xlApp.Sheets("sheet6").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第五頁"
  220. End If
  221. xlBook.Activate() : xlSheet.Activate() : 列印1() : Q1 = 0
  222. ElseIf i = 10 Then
  223. FF(xlApp, xlSheet)
  224. xlSheet = NewMethod(xlBook)
  225. If xlApp.Sheets(1).Name = "工作表7" Then
  226. xlApp.Sheets("工作表7").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第六頁"
  227. Else
  228. xlApp.Sheets("sheet7").Name = DataGridView1.Rows(0).Cells("型體名稱").Value & "第六頁"
  229. End If
  230. xlBook.Activate() : xlSheet.Activate() : 列印1() : Q1 = 0
  231. End If
  232. End If
  233. N6 += 1 : N7 += 1 : N9 = Q1 + N2 + N4 + N5
  234. xlSheet.Cells(Q1 + N2 + N4 + N5 + 13, 1) = "#" : xlSheet.Cells(Q1 + N2 + N4 + N5 + 13, 2) = "COLOR (顏色)" : xlSheet.Cells(Q1 + N2 + N4 + N5 + 13, 8) = "PRS (雙數)"
  235. xlSheet.Cells(Q1 + N2 + N4 + N5 + 13, 11) = "SIZE (尺寸)" : xlSheet.Cells(Q1 + N2 + N4 + N5 + 13, 14) = "KEEP (留底)" : xlSheet.Cells(Q1 + N2 + N4 + N5 + 13, 17) = "LOC (位置)"
  236. xlSheet.Cells(Q1 + N2 + N4 + N5 + 13, 20) = "LEND BY(借出者)"
  237. xlSheet.Cells(Q1 + N2 + N4 + N5 + 14, 1) = DataGridView2.Rows(i).Cells("項次").Value : xlSheet.Cells(Q1 + N2 + N4 + N5 + 14, 2) = DataGridView2.Rows(i).Cells("顏色").Value
  238. xlSheet.Cells(Q1 + N2 + N4 + N5 + 14, 8) = DataGridView2.Rows(i).Cells("數量").Value : xlSheet.Cells(Q1 + N2 + N4 + N5 + 14, 11) = DataGridView2.Rows(i).Cells("SIZE").Value
  239. xlSheet.Cells(Q1 + N2 + N4 + N5 + 14, 14) = DataGridView2.Rows(i).Cells("KEEP").Value : xlSheet.Cells(Q1 + N2 + N4 + N5 + 14, 17) = DataGridView2.Rows(i).Cells("架號").Value
  240. xlSheet.Cells(Q1 + N2 + N4 + N5 + 14, 20) = DataGridView2.Rows(i).Cells("借出者").Value
  241. xlSheet.Cells(Q1 + N2 + N4 + N5 + 15, 1) = "#" : xlSheet.Cells(Q1 + N2 + N4 + N5 + 15, 2) = "DESCRIPTION (部件說明)" : xlSheet.Cells(Q1 + N2 + N4 + N5 + 15, 8) = "MATERIALS (材料名稱)"
  242. xlSheet.Cells(Q1 + N2 + N4 + N5 + 15, 14) = "COLOR (顏色)" : xlSheet.Cells(Q1 + N2 + N4 + N5 + 15, 20) = "SUPPLIER (廠商)" : xlSheet.Cells(Q1 + N2 + N4 + N5 + 15, 24) = "REMARKS (備註)"
  243. BB(xlApp, xlSheet)
  244. PictureBox1.Image = Nothing
  245. ConnOpen()
  246. SQL1 = "SELECT TOP(1) 圖片 FROM 鞋型圖片資料庫 " &
  247. "WHERE 客戶 LIKE N'" & DataGridView1.Rows(0).Cells("客戶").Value & "' AND 形體號 LIKE N'" & DataGridView1.Rows(0).Cells("型體號碼").Value &
  248. "' AND 形體名 LIKE N'" & DataGridView1.Rows(0).Cells("型體名稱").Value & "' AND 顏色 LIKE N'" & DataGridView2.Rows(i).Cells("顏色").Value & "'"
  249. CmdSet_For_dr()
  250. If dr.Read() Then
  251. PictureBox1.Image = Nothing
  252. ConnOpen()
  253. SQL1 = "SELECT TOP(1) 圖片 FROM 鞋型圖片資料庫 " &
  254. "WHERE 客戶 LIKE N'" & DataGridView1.Rows(0).Cells("客戶").Value & "' AND 形體號 LIKE N'" & DataGridView1.Rows(0).Cells("型體號碼").Value &
  255. "' AND 形體名 LIKE N'" & DataGridView1.Rows(0).Cells("型體名稱").Value & "' AND 顏色 LIKE N'" & DataGridView2.Rows(i).Cells("顏色").Value & "'"
  256. CmdSet_For_dr()
  257. While dr.Read() = True
  258. Dim bytes As Byte() = New Byte(-1) {} : bytes = DirectCast(dr.Item("圖片"), Byte()) : Dim oStream As New MemoryStream(bytes) : PictureBox1.Image = Bitmap.FromStream(oStream)
  259. End While
  260. conn.Close() : HH(xlApp, xlSheet)
  261. Else
  262. xlSheet.Cells(Q1 + N2 + N4 + N5 + 13, 28) = "系統中無圖片"
  263. conn.Close()
  264. End If : PictureBox1.SizeMode = 4
  265. N3 = 0 ':
  266. For ii As Integer = 0 To DataGridView3.Rows.Count - 1
  267. xlSheet.Cells(ii + N2 + N4 + N5 + 16 + N6, 2) = DataGridView3.Rows(ii).Cells("部件類別").Value
  268. N10 = ii + N2 + N4 + N5 + N6 : CC(xlApp, xlSheet)
  269. DataGridView4.DataSource = Nothing : ds3.Clear()
  270. DataGridView4.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  271. DataGridView4.ColumnHeadersHeight = 25
  272. DataGridView4.AllowUserToAddRows = False
  273. ConnOpen()
  274. SQL1 = "SELECT SO, 項次, 部件, 材料名稱, 材料說明, 備註, 廠商, 版次, 流水號 FROM 樣品訂單部件表 " &
  275. "WHERE (SO LIKE N'" & 列印用SQL & "') AND (版次 LIKE N'" & 列印用SQL2 & "') AND (流水號 LIKE N'" & DataGridView2.Rows(i).Cells("流水號").Value & "') " &
  276. "AND (部件 LIKE N'" & DataGridView3.Rows(ii).Cells("部件").Value & "%') ORDER BY 項次, 部件"
  277. CmdSet_For_DGV()
  278. da.Fill(ds3) : DataGridView4.DataSource = ds3.Tables(0) : conn.Close()
  279. For iii As Integer = 0 To DataGridView4.Rows.Count - 1
  280. xlSheet.Cells(iii + N2 + N3 + N8 + N5 + N6 + N7 + 17, 1) = DataGridView2.Rows(i).Cells("項次").Value
  281. xlSheet.Cells(iii + N2 + N3 + N8 + N5 + N6 + N7 + 17, 2) = DataGridView4.Rows(iii).Cells("部件").Value
  282. xlSheet.Cells(iii + N2 + N3 + N8 + N5 + N6 + N7 + 17, 8) = DataGridView4.Rows(iii).Cells("材料名稱").Value
  283. xlSheet.Cells(iii + N2 + N3 + N8 + N5 + N6 + N7 + 17, 14) = DataGridView4.Rows(iii).Cells("材料說明").Value
  284. xlSheet.Cells(iii + N2 + N3 + N8 + N5 + N6 + N7 + 17, 20) = DataGridView4.Rows(iii).Cells("廠商").Value
  285. xlSheet.Cells(iii + N2 + N3 + N8 + N5 + N6 + N7 + 17, 24) = DataGridView4.Rows(iii).Cells("備註").Value
  286. If Len(DataGridView4.Rows(iii).Cells("材料名稱").Value) > 45 Then
  287. ww1 = True
  288. Else
  289. ww1 = False
  290. End If
  291. If Len(DataGridView4.Rows(iii).Cells("備註").Value) > 25 Then
  292. ww2 = True
  293. Else
  294. ww2 = False
  295. End If
  296. N1 = iii + 1 : N11 = iii + N2 + N3 + N8 + N5 + N6 + N7 : DD(xlApp, xlSheet)
  297. Next iii
  298. N2 += N1 : N3 = ii + 1
  299. Next ii
  300. N4 = N4 + N3 + 1 : N8 += N3
  301. With xlApp.Selection : .Font.Bold = True : End With
  302. N5 += 2 : EE(xlApp, xlSheet) : Q1 += 1
  303. Next i
  304. FF(xlApp, xlSheet)
  305. xlSheet.PageSetup.PrintArea = ""
  306. xlApp.Cells.Select()
  307. xlSheet.Range("B1").Select()
  308. xlApp.Application.WindowState = xlMinimized
  309. MsgBox("列印完成")
  310. Me.Close()
  311. End If
  312. End Sub
  313. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  314. 列印用SQL = "" : Me.Close()
  315. End Sub
  316. Private Shared Function NewMethod(xlBook As Microsoft.Office.Interop.Excel.Workbook) As Microsoft.Office.Interop.Excel.Worksheet
  317. Return CType(xlBook.Worksheets.Add, Microsoft.Office.Interop.Excel.Worksheet)
  318. End Function
  319. Private Sub AA(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Microsoft.Office.Interop.Excel.Worksheet)
  320. xlSheet.Cells.Select()
  321. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 10 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  322. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  323. xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 3
  324. xlSheet.Columns("B:G").Select : myExcel.Selection.ColumnWidth = 4
  325. xlSheet.Columns("H:M").Select : myExcel.Selection.ColumnWidth = 8
  326. xlSheet.Columns("N:AH").Select : myExcel.Selection.ColumnWidth = 3
  327. xlSheet.Range("A1").Select()
  328. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 26 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  329. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  330. xlSheet.Range("U1").Select()
  331. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 22 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  332. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  333. xlSheet.Range("A2").Select()
  334. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 14 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  335. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  336. xlSheet.Range("A3").Select()
  337. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 14 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  338. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  339. xlSheet.Range("A3:AH3").Select()
  340. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  341. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  342. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  343. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  344. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  345. xlSheet.Rows("4:4").Select : myExcel.Selection.RowHeight = 3
  346. xlSheet.Range("G5:M5").Select() : myExcel.Selection.Merge
  347. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  348. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  349. xlSheet.Range("G6:M6").Select() : myExcel.Selection.Merge
  350. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  351. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  352. xlSheet.Range("G7:M7").Select() : myExcel.Selection.Merge
  353. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  354. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  355. xlSheet.Range("G8:M8").Select() : myExcel.Selection.Merge
  356. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  357. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  358. xlSheet.Range("G9:M9").Select() : myExcel.Selection.Merge
  359. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  360. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  361. xlSheet.Range("G10:M10").Select() : myExcel.Selection.Merge
  362. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  363. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  364. xlSheet.Range("G11:M11").Select() : myExcel.Selection.Merge
  365. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  366. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  367. xlSheet.Range("T5:Z5").Select() : myExcel.Selection.Merge
  368. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  369. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  370. xlSheet.Range("T6:Z6").Select() : myExcel.Selection.Merge
  371. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  372. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  373. xlSheet.Range("T7:Z7").Select() : myExcel.Selection.Merge
  374. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  375. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  376. xlSheet.Range("T8:Z8").Select() : myExcel.Selection.Merge
  377. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  378. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  379. xlSheet.Range("T9:Z9").Select() : myExcel.Selection.Merge
  380. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  381. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  382. xlSheet.Range("T10:Z10").Select() : myExcel.Selection.Merge
  383. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  384. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  385. xlSheet.Range("T11:Z11").Select() : myExcel.Selection.Merge
  386. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  387. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  388. xlSheet.Range("AA3:AC3").Select() : myExcel.Selection.Merge
  389. xlSheet.Range("A11:AH11").Select()
  390. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  391. myExcel.Selection.Borders(xlEdgeLeft).LineStyle = xlNone : myExcel.Selection.Borders(xlEdgeTop).LineStyle = xlNone
  392. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  393. myExcel.Selection.Borders(xlEdgeRight).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone
  394. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  395. xlSheet.Range("AB5:AH11").Select() : myExcel.Selection.Merge
  396. xlSheet.Columns("A:A").Select : myExcel.Selection.NumberFormatLocal = "@"
  397. myExcel.ActiveWindow.DisplayGridlines = False
  398. End Sub
  399. Private Sub BB(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Microsoft.Office.Interop.Excel.Worksheet)
  400. Dim 位置1 As String
  401. 位置1 = 12 + N9 & ":" & 12 + N9 : xlSheet.Rows(位置1).Select : myExcel.Selection.RowHeight = 3
  402. 位置1 = 13 + N9 & ":" & 13 + N9 : xlSheet.Rows(位置1).Select : myExcel.Selection.RowHeight = 30
  403. 位置1 = 14 + N9 & ":" & 14 + N9 : xlSheet.Rows(位置1).Select : myExcel.Selection.RowHeight = 30
  404. 位置1 = 15 + N9 & ":" & 15 + N9 : xlSheet.Rows(位置1).Select : myExcel.Selection.RowHeight = 15
  405. 位置1 = "A" & 13 + N9 & ":W" & 13 + N9 : xlSheet.Range(位置1).Select()
  406. With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .ThemeColor = xlThemeColorAccent1 : .TintAndShade = 0.799981688894314 : .PatternTintAndShade = 0 : End With
  407. 位置1 = "A" & 15 + N9 & ":AH" & 15 + N9 : xlSheet.Range(位置1).Select()
  408. With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .ThemeColor = xlThemeColorAccent1 : .TintAndShade = 0.799981688894314 : .PatternTintAndShade = 0 : End With
  409. 位置1 = "A" & 13 + N9 & ":A" & 15 + N9 : xlSheet.Range(位置1).Select()
  410. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  411. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  412. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  413. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  414. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  415. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  416. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  417. 位置1 = "B" & 13 + N9 & ":G" & 13 + N9 : xlSheet.Range(位置1).Select()
  418. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  419. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  420. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  421. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  422. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  423. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  424. 位置1 = "B" & 14 + N9 & ":G" & 14 + N9 : xlSheet.Range(位置1).Select()
  425. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  426. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  427. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  428. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  429. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  430. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  431. 位置1 = "H" & 13 + N9 & ":J" & 13 + N9 : xlSheet.Range(位置1).Select()
  432. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  433. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  434. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  435. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  436. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  437. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  438. 位置1 = "H" & 14 + N9 & ":J" & 14 + N9 : xlSheet.Range(位置1).Select()
  439. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  440. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  441. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  442. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  443. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  444. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  445. 位置1 = "K" & 13 + N9 & ":M" & 13 + N9 : xlSheet.Range(位置1).Select()
  446. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  447. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  448. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  449. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  450. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  451. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  452. 位置1 = "K" & 14 + N9 & ":M" & 14 + N9 : xlSheet.Range(位置1).Select()
  453. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  454. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  455. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  456. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  457. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  458. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  459. 位置1 = "N" & 13 + N9 & ":P" & 13 + N9 : xlSheet.Range(位置1).Select()
  460. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  461. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  462. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  463. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  464. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  465. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  466. 位置1 = "N" & 14 + N9 & ":P" & 14 + N9 : xlSheet.Range(位置1).Select() : myExcel.Selection.Merge
  467. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  468. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  469. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  470. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  471. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  472. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  473. 位置1 = "Q" & 13 + N9 & ":S" & 13 + N9 : xlSheet.Range(位置1).Select()
  474. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  475. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  476. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  477. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  478. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  479. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  480. 位置1 = "Q" & 14 + N9 & ":S" & 14 + N9 : xlSheet.Range(位置1).Select()
  481. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  482. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  483. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  484. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  485. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  486. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  487. 位置1 = "T" & 13 + N9 & ":W" & 13 + N9 : xlSheet.Range(位置1).Select()
  488. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  489. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  490. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  491. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  492. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  493. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  494. 位置1 = "T" & 14 + N9 & ":W" & 14 + N9 : xlSheet.Range(位置1).Select()
  495. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  496. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  497. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  498. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  499. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  500. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  501. 位置1 = "AB" & 13 + N9 & ":AH" & 14 + N9 : xlSheet.Range(位置1).Select()
  502. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  503. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  504. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  505. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  506. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  507. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  508. 位置1 = "B" & 15 + N9 & ":G" & 15 + N9 : xlSheet.Range(位置1).Select()
  509. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  510. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  511. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  512. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  513. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  514. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  515. 位置1 = "H" & 15 + N9 & ":M" & 15 + N9 : xlSheet.Range(位置1).Select()
  516. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  517. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  518. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  519. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  520. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  521. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  522. 位置1 = "N" & 15 + N9 & ":S" & 15 + N9 : xlSheet.Range(位置1).Select()
  523. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  524. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  525. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  526. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  527. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  528. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  529. 位置1 = "T" & 15 + N9 & ":W" & 15 + N9 : xlSheet.Range(位置1).Select()
  530. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  531. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  532. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  533. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  534. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  535. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  536. 位置1 = "X" & 15 + N9 & ":AH" & 15 + N9 : xlSheet.Range(位置1).Select()
  537. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  538. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  539. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  540. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  541. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  542. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  543. 位置1 = "AB" & 13 + N9 & ":AH" & 14 + N9 : xlSheet.Range(位置1).Select() : myExcel.Selection.Merge
  544. End Sub
  545. Private Sub CC(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Microsoft.Office.Interop.Excel.Worksheet)
  546. Dim 位置1 As String
  547. 位置1 = 16 + N10 & ":" & 16 + N10 : xlSheet.Rows(位置1).Select : myExcel.Selection.RowHeight = 15
  548. 位置1 = "A" & 16 + N10 & ":AH" & 16 + N10 : xlSheet.Range(位置1).Select()
  549. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  550. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  551. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  552. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  553. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  554. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  555. 位置1 = "B" & 16 + N10 & ":G" & 16 + N10 : xlSheet.Range(位置1).Select() : myExcel.Selection.Merge
  556. With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .ThemeColor = xlThemeColorAccent6 : .TintAndShade = 0.799981688894314 : .PatternTintAndShade = 0 : End With
  557. End Sub
  558. Private Sub DD(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Microsoft.Office.Interop.Excel.Worksheet)
  559. Dim 位置1 As String
  560. 位置1 = "A" & 17 + N11 : xlSheet.Range(位置1).Select()
  561. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  562. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  563. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  564. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  565. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  566. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  567. 位置1 = "B" & 17 + N11 & ":G" & 17 + N11 : xlSheet.Range(位置1).Select()
  568. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  569. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  570. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  571. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  572. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  573. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  574. 位置1 = "H" & 17 + N11 & ":M" & 17 + N11 : xlSheet.Range(位置1).Select()
  575. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  576. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  577. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  578. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  579. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  580. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  581. 位置1 = "N" & 17 + N11 & ":S" & 17 + N11 : xlSheet.Range(位置1).Select()
  582. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  583. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  584. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  585. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  586. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  587. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  588. 位置1 = "T" & 17 + N11 & ":W" & 17 + N11 : xlSheet.Range(位置1).Select()
  589. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  590. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  591. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  592. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  593. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  594. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  595. 位置1 = "X" & 17 + N11 & ":AH" & 17 + N11 : xlSheet.Range(位置1).Select()
  596. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  597. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  598. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  599. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlHairline : End With
  600. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  601. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  602. 位置1 = "B" & 17 + N11 & ":G" & 17 + N11 : xlSheet.Range(位置1).Select() : myExcel.Selection.Merge
  603. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  604. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  605. 位置1 = "H" & 17 + N11 & ":M" & 17 + N11 : xlSheet.Range(位置1).Select() : myExcel.Selection.Merge
  606. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  607. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  608. 位置1 = "N" & 17 + N11 & ":S" & 17 + N11 : xlSheet.Range(位置1).Select() : myExcel.Selection.Merge
  609. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  610. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  611. 位置1 = "T" & 17 + N11 & ":W" & 17 + N11 : xlSheet.Range(位置1).Select() : myExcel.Selection.Merge
  612. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  613. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  614. 位置1 = "X" & 17 + N11 & ":AH" & 17 + N11 : xlSheet.Range(位置1).Select() : myExcel.Selection.Merge
  615. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  616. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
  617. 位置1 = 17 + N11 & ":" & 17 + N11 : xlSheet.Rows(位置1).Select
  618. With myExcel.Selection : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : End With
  619. If ww1 = False And ww2 = False Then
  620. 位置1 = 17 + N11 & ":" & 17 + N11 : xlSheet.Rows(位置1).Select : myExcel.Selection.RowHeight = 15
  621. Else
  622. 位置1 = 17 + N11 & ":" & 17 + N11 : xlSheet.Rows(位置1).Select : myExcel.Selection.RowHeight = 30
  623. End If
  624. End Sub
  625. Private Sub EE(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Microsoft.Office.Interop.Excel.Worksheet)
  626. Dim 位置1 As String
  627. 位置1 = "A" & 13 + N9 & ":AH" & 17 + N11 : xlSheet.Range(位置1).Select()
  628. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  629. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  630. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  631. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  632. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  633. End Sub
  634. Private Sub FF(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Microsoft.Office.Interop.Excel.Worksheet)
  635. xlSheet.Columns("A:AH").Select
  636. myExcel.ActiveSheet.PageSetup.PrintArea = "$A:$AH"
  637. myExcel.Application.PrintCommunication = False
  638. With myExcel.ActiveSheet.PageSetup : .PrintTitleRows = "$1:$12" : .PrintTitleColumns = "" : End With
  639. myExcel.Application.PrintCommunication = True : myExcel.ActiveSheet.PageSetup.PrintArea = "$A:$AH" : myExcel.Application.PrintCommunication = False
  640. With myExcel.ActiveSheet.PageSetup : .LeftHeader = "" : .CenterHeader = "" : .RightHeader = "" : .LeftFooter = "" : .CenterFooter = "" : .RightFooter = ""
  641. .LeftMargin = myExcel.Application.InchesToPoints(0.196850393700787) : .RightMargin = myExcel.Application.InchesToPoints(0.196850393700787)
  642. .TopMargin = myExcel.Application.InchesToPoints(0.393700787401575) : .BottomMargin = myExcel.Application.InchesToPoints(0.196850393700787)
  643. .HeaderMargin = myExcel.Application.InchesToPoints(0) : .FooterMargin = myExcel.Application.InchesToPoints(0) : .PrintHeadings = False : .PrintGridlines = False
  644. .PrintQuality = 600 : .CenterHorizontally = True : .CenterVertically = False : .Draft = False : .FirstPageNumber = xlAutomatic : .BlackAndWhite = False
  645. .Zoom = False : .FitToPagesWide = 1 : .FitToPagesTall = 0 : .OddAndEvenPagesHeaderFooter = False : .DifferentFirstPageHeaderFooter = False
  646. .ScaleWithDocHeaderFooter = True : .AlignMarginsHeaderFooter = True : .EvenPage.LeftHeader.Text = "" : .EvenPage.CenterHeader.Text = "" : .EvenPage.RightHeader.Text = ""
  647. .EvenPage.LeftFooter.Text = "" : .EvenPage.CenterFooter.Text = "" : .EvenPage.RightFooter.Text = "" : .FirstPage.LeftHeader.Text = "" : .FirstPage.CenterHeader.Text = ""
  648. .FirstPage.RightHeader.Text = "" : .FirstPage.LeftFooter.Text = "" : .FirstPage.CenterFooter.Text = "" : .FirstPage.RightFooter.Text = ""
  649. End With
  650. myExcel.Application.PrintCommunication = True
  651. End Sub
  652. Private Sub GG(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Microsoft.Office.Interop.Excel.Worksheet)
  653. Dim 位置1 As String
  654. Clipboard.SetDataObject(PictureBox1.Image)
  655. 位置1 = "AB5" : xlSheet.Range(位置1).Select()
  656. myExcel.ActiveSheet.Pictures.Paste.Select
  657. myExcel.Selection.ShapeRange.Height = 79
  658. End Sub
  659. Private Sub HH(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Microsoft.Office.Interop.Excel.Worksheet)
  660. Dim 位置1 As String
  661. Clipboard.SetDataObject(PictureBox1.Image)
  662. 位置1 = "AB" & N9 + 13 : xlSheet.Range(位置1).Select()
  663. myExcel.ActiveSheet.Pictures.Paste.Select
  664. myExcel.Selection.ShapeRange.Height = 59
  665. End Sub
  666. Private Sub CheckBox3_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox3.Click
  667. CheckBox3.Checked = True : CheckBox1.Checked = False : CheckBox2.Checked = False
  668. End Sub
  669. Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.Click
  670. CheckBox3.Checked = False : CheckBox1.Checked = True : CheckBox2.Checked = False
  671. End Sub
  672. Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox2.Click
  673. CheckBox3.Checked = False : CheckBox1.Checked = False : CheckBox2.Checked = True
  674. End Sub
  675. End Class