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

[µo°Ý] ¦Û°Ê¥h°£ .References "¿òº|" ¶µ;isbroken, Count¥¢®Ä

[µo°Ý] ¦Û°Ê¥h°£ .References "¿òº|" ¶µ;isbroken, Count¥¢®Ä

¥»©«³Ì«á¥Ñ Scott090 ©ó 2013-5-15 22:36 ½s¿è




·í¦³¦p¹Ïªº ¿òº|¶µ¦s¦b®É¡A¤U¦Cªº«ü¥O³£¥¢®Ä
Dim i as integer,myref

i = Thisworkbook.VBProject.References.Count
©Î
For each myref in Thisworkbook.VBProject.References

½Ð°Ý°ª¤â¤j®v¡A¦³¦ó¤èªk¦b Workbook open ®É¯à§â ¿òº|ªº¥´¤Ä¶µ¥h°£
©ÎªÌ
Àˬd¥X¿òº|¶µ¡A remove³o¿òº|¶µ

¦^´_ 1# Scott090


    ³o­Ó°ÝÃD¦n¹³«Ü½M¡A¨S¤H·QÀ°¦£«ü¾É   :(

TOP

¦^´_ 2# Scott090

¸Õ¸Õ¬Ý¬O§_¥i¦æ?
¤Ä¿ï"«H¥ô¦s¨úVBA±M®×ª«¥ó¼Ò«¬"

  1. Sub ex()
  2. For Each ref In ThisWorkbook.VBProject.References
  3. If Dir(ref.Fullpath) = "" Then Remove ref
  4. Next
  5. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 3# Hsieh


    ¦hÁ¤j«L¥X¤â¬Û±Ï
«H¥ô¤Ä¿ï¦bµo°Ý¤§«e´N¦³°µ
¤£¦Pªº¹q¸£¨t²Î¤ÀÄÝ2³BµLªk°¨¤W°µ¡A¤j«Lªº«üÂI±N¸ÕÅç«á¦^´_µ²ªG

TOP

¦^´_ 4# Scott090
ÁÙ¬O­n¤â°Ê
  1. Option Explicit
  2. Private Sub Workbook_Open()
  3.     ³]©w¤Þ¥Î¶µ¥Ø
  4.     '....µ{¦¡½X
  5.     '....µ{¦¡½X
  6. End Sub
  7. Private Sub ³]©w¤Þ¥Î¶µ¥Ø()  '¿òº|¶µ¦s¦b®É¥Î¤â°Ê§R°£,¥Î¤â°Ê¦sÀÉ«á­«·s°õ¦æµ{¦¡.
  8.     Dim E
  9.     On Error Resume Next
  10.     With ThisWorkbook.VBProject
  11.         For Each E In .References
  12.          Debug.Print E.Name
  13.         Next
  14.     End With
  15.     If Err <> 0 Then
  16.        Application.CommandBars.FindControl(ID:=1561).Execute
  17.        Application.SendKeys "%T"
  18.        Application.SendKeys "R"
  19.       End
  20.     End If
  21. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 5# GBKEE


    ÁÂÁ GBKEE ¤j«L¶}ÅP¥t¤@¤èªk¡A´N¬O¦³¿ù®ÉÅã¥Ü¥X ¤Þ¥Î¶µµ¡Åé¨Ó´£¥Ü¨Ï¥ÎªÌ­×§ï©Î¥h°£¥´¤Äªº"¿òº|" ¤Þ¥Î¶µ

TOP

        ÀR«ä¦Û¦b : ¤Ó¶§¥ú¤j¡B¤÷¥À®¦¤j¡B§g¤l¶q¤j¡A¤p¤H®ð¤j¡C
ªð¦^¦Cªí ¤W¤@¥DÃD