ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] on error resume next¥d¦bµL­­°j°é

[µo°Ý] on error resume next¥d¦bµL­­°j°é

¥»©«³Ì«á¥Ñ smart3135 ©ó 2017-11-11 10:08 ½s¿è

·Q½Ð±Ð¤@¤U¦U¦ì«e½ú¡A¦]¬°§Ú¤½¥q¦³¨Ç¤u§@¬O»Ý­n­«½Æ°õ¦æ

§âEXCEL¤º®e¼g¨ì°O¨Æ¥»¸Ì¡A³o¨â¤Ñ°µ¤F«Ü¦h¥\½Ò

¤j­P¤W«e¥b¬qµ{¦¡½X¤w¸g¼gªº®t¤£¦h¤F

³Ñ¤U´N¬O«á¥b¬q¼g¤J°O¨Æ¥»(ÁÙ¨S¶}©lµÛ¤â)

¦ý¬O²{¦b¹J¨ì¤@­ÓÃøÃD¡A´N¬O«e¥b¬qªºµ{¦¡½X

¦b§ì¨ú¤£¨ì¬Û¹ïÀ³ªººô­¶®É·|¥X²{¿ù»~µøµ¡

§Úª¾¹D¥i¥H¥Îon error resume next¨Ó©¿²¤¿ù»~

¦ý«o·|¥d¦b±µ¤U¨ÓªºDo While .Busy Or .ReadyState <> 4: DoEvents: Loop

§Î¦¨µL­­°j°é¡A¦Ó¦pªG¨Ï¥Î¥t¤@ºØon error goto XX

¦b§Ú¦Û¤v³]©wªº°j°é¤¤¡A²Ä¤@¦¸¬O¥i¥H¸õ¨ì·Q­nªºµ{§Ç¦ì¸m

¦ý°õ¦æ²Ä¤G¦¸´N·|¥X¿ù¡A¤£ª¾¹D¬°¤°»ò¡A¹ê¬O¦b§ä¤£¨ì¤èªk¤F¡A©Ò¥H¤~¨Ó½Ð±Ð¦U¦ì«e½ú

³Ì²z·Qªº±¡ªp´N¬O§ì¤£¨ìºô­¶®É³s¿ù»~µøµ¡³£¤£­n¸õ¥X

ª½±µ¸õ¨ì§Ú³]©w°j°éªºNEXT¡A³Â·Ð¦U¦ì«e½ú«üÂI¤@¤U¡AÁÂÁ¡C
¤£ª¾¹D¬°¤°»òÀ£ÁYÀɪºÀɮץᤣ¤W¨Ó
¥u¯à©ñ¤Wµ{¦¡½X
  1. Option Explicit

  2. Sub Ex1()

  3. On Error GoTo AR

  4. Dim A, B, C, D, E, F, G, H, I, J, K As String, R, rng As Range

  5. Dim URL, URL1, URL2, URL3, URL4, URL5, URL6, URL7, URL8, URL9, URL10 As String

  6. J = InputBox("½Ð¿é¤Jºô­¶¸¹½X")

  7. H = InputBox("½Ð¿é¤J¤u³æ¸¹½X")

  8. With Sheets(2)

  9. Set rng = .Range("A1", .Range("A65535").End(xlUp))

  10. End With

  11. 'URL1 = "C:\FujiFlexa\Client\Report\Jobdata\job00" & J & "\NXTL_Feeder SetupRepIndex_T.html"

  12. 'URL2 = "C:\FujiFlexa\Client\Report\Jobdata\job00" & J & "\NXTL_Part PlacementRepIndex_T.html"

  13. 'URL3 = "C:\FujiFlexa\Client\Report\Jobdata\job00" & J & "\XPF_Feeder SetupRepIndex_T.html"

  14. 'URL4 = "C:\FujiFlexa\Client\Report\Jobdata\job00" & J & "\XPF_Part PlacementRepIndex_T.html"

  15. 'URL5 = "C:\FujiFlexa\Client\Report\Jobdata\job00" & J & "\NXTL_Feeder SetupRepIndex_B.html"

  16. 'URL6 = "C:\FujiFlexa\Client\Report\Jobdata\job00" & J & "\NXTL_Part PlacementRepIndex_B.html"

  17. 'URL7 = "C:\FujiFlexa\Client\Report\Jobdata\job00" & J & "\XPF_Feeder SetupRepIndex_B.html"

  18. 'URL8 = "C:\FujiFlexa\Client\Report\Jobdata\job00" & J & "\XPF_Part PlacementRepIndex_B.html"

  19. 'URL9 = "C:\FujiFlexa\Client\Report\Jobdata\job00" & J & "\XPFB_Feeder SetupRepIndex_B.html"

  20. 'URL10 = "C:\FujiFlexa\Client\Report\Jobdata\job00" & J & "\XPFB_Part PlacementRepIndex_B.html"



  21. With CreateObject("InternetExplorer.Application")

  22. For Each URL In rng

  23. URL1 = "C:\FujiFlexa\Client\Report\Jobdata\job00" & J & URL

  24. .Visible = False

  25. ' On Error Resume Next

  26. On Error GoTo AR



  27. ' On Error Resume Next '§ä¤£¨ìºô­¶ÁÙµLªk¸Ñ¨M

  28. ' On Error GoTo 0

  29. .Navigate URL1



  30. Do While .Busy Or .ReadyState <> 4: DoEvents: Loop

  31. .execwb 17, 2 '¿ï¨ú ºô­¶¤º®e

  32. .execwb 12, 2 '½Æ»s ºô­¶¤º®e



  33. Sheets(1).Activate

  34. With ActiveSheet '«ü©w¤u§@ªí

  35. .Cells.Clear '²M²z ¤u§@ªí

  36. .[a1].Select

  37. .PasteSpecial Format:="Unicode ¤å¦r", Link:=False, DisplayAsIcon:= _

  38. False, NoHTMLFormatting:=True



  39. .[a1].Select

  40. End With

  41. .Quit





  42. If InStr([A2], "Feeder") Then

  43. A = "_" + Mid([A7], 9, 3) + "A" + Right([A9], 2) 'NXTA_T

  44. ' MsgBox A

  45. B = Left([A9], Len([A9]) - 2) '¥h±¼§À¤Úªº_T



  46. If InStr(Mid(B, 13, 3), "_") Then

  47. C = Mid(B, 13, 3) '¦pªG¦³_´N¬OLA©ÎLB

  48. Else

  49. C = Mid(B, 13, 4) '¦pªG¨S¦³´N¬OLAB©ÎLBB

  50. End If

  51. If InStr(Mid([A9], 23, 1), "_") Then

  52. D = Right(B, Len(B) - 22) '§ìµ{¦¡ª©¥»

  53. Else

  54. D = Right(B, Len(B) - 21) '§ìµ{¦¡ª©¥»

  55. End If

  56. I = "_" + Mid([A11], 10, 6)

  57. Else

  58. A = "_" + Mid([A7], 9, 3) + "A" + Right([A8], 2) + "S" 'NXTA_TS

  59. ' MsgBox A

  60. B = Left([A8], Len([A8]) - 2) '¥h±¼§À¤Úªº_T

  61. If InStr(Mid(B, 13, 3), "_") Then

  62. C = Mid(B, 13, 3) '¦pªG¦³_´N¬OLA©ÎLB

  63. Else

  64. C = Mid(B, 13, 4) '¦pªG¨S¦³´N¬OLAB©ÎLBB

  65. End If

  66. If InStr(Mid([A8], 23, 1), "_") Then

  67. D = Right(B, Len(B) - 22) '§ìµ{¦¡ª©¥»

  68. Else

  69. D = Right(B, Len(B) - 21) '§ìµ{¦¡ª©¥»

  70. End If

  71. I = "_" + Mid([A10], 10, 6)

  72. End If

  73. ' MsgBox B

  74. ' MsgBox C

  75. ' MsgBox D





  76. E = C + H + D + I + A

  77. MsgBox E

  78. AR:

  79. Next

  80. End With



  81. End Sub
½Æ»s¥N½X

¦^´_ 1# smart3135
¤W¶ÇªþÀÉ ¥ÎÂX®i¦W: chm, pdf, zip, rar, tar, gz, bzip2, gif, jpg, jpeg, png
  1. Option Explicit
  2. Sub Ex1()
  3.     Dim IE As Object
  4.     Dim Rng As Range, UrL As String, R As Range, j
  5.     Set IE = CreateObject("InternetExplorer.Application")
  6.     With Sheets(2)
  7.         Set Rng = .Range("A1", .Range("A65535").End(xlUp))
  8.     End With
  9.     For Each R In Rng
  10.         UrL = "C:\FujiFlexa\Client\Report\Jobdata\job00" & j & R
  11.         If Dir(UrL) = "" Then 'Àˬd¤£¨ìÀÉ®×
  12.             If MsgBox("§ä¤£¨ì " & UrL & vbLf & "¬O(Y):Ä~Äò¤U¤@­Óºô­¶" & vbLf & "§_(N):µ²§ôµ{¦¡", vbYesNo) = vbYes Then
  13.                 GoTo AG1
  14.             Else
  15.                 IE.Quit
  16.                 Exit Sub
  17.             End If
  18.         End If
  19.         With IE
  20.             .Navigate UrL
  21.             Do While .Busy Or .readyState <> 4: DoEvents: Loop
  22.             '**************
  23.             'µ{¦¡½X********
  24.             '**************
  25.         End With
  26. AG1:
  27.     Next
  28.     IE.Quit
  29. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_  smart3135
¤W¶ÇªþÀÉ ¥ÎÂX®i¦W: chm, pdf, zip, rar, tar, gz, bzip2, gif, jpg, jpeg, png
GBKEE µoªí©ó 2017-11-11 14:54

¤£¦n·N«ä¡A¤£ª¾¬°¤°»ò¥Î¤â¾÷µLªk¤W¶Ç¡A¦^¨ì®a¤¤¥Î¹q¸£¤~¥i¥H
¥Ø«e¤H¤wÂ÷¶}¤½¥q¡AµLªk¸ÕG¤j´£¨Ñªºµ{¦¡½X¡A¤j·§¤F¸Ñ¥¦ªºÅÞ¿è
­nµ¥¤U¬P´Á¨ì¤½¥q¤~¯à¦A¸Õ¬Ý¬Ý¤F¡A¥ý·PÁ±z
test.zip (23.17 KB)

TOP

        ÀR«ä¦Û¦b : ·O´d¨S¦³¼Ä¤H¡A´¼¼z¤£°_·Ð´o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD