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

[µo°Ý] ÅýÄÝ©ÊÁôÂä§ÀÉ¥ç¦b³Q¦C¥X¿ï¾Ü½d³ò¤º?

[µo°Ý] ÅýÄÝ©ÊÁôÂä§ÀÉ¥ç¦b³Q¦C¥X¿ï¾Ü½d³ò¤º?

½Ð±Ð½Ñ¦ì¤j¤j:
    Filt = "Excel Files (*.xls),*.xls"
    FilterIndex = 5
    Title = "Select a File to Import"
    FileName = Application.GetOpenFilename _
        (FileFilter:=Filt, _
         FilterIndex:=FilterIndex, _
         Title:=Title)
    If FileName = False Then
        MsgBox "No file was selected."
        Exit Sub
    End If
¥i§_ÅýÄÝ©ÊÁôÂä§ÀÉ¥ç¦b³Q¦C¥X¿ï¾Ü½d³ò¤º
»yªk¬O??
ÁÂÁÂ

³oÀ³¸Ó¬OWindowsªº°ÝÃD¡C

TOP

¦^´_ 1# yangjie

Application.GetOpenFilename  ¤£¯àÅã¥ÜÄÝ©ÊÁôÂêºÀÉ®×
¸Õ¸Õ¬Ý Dir ªº±`¼Æ
  1. ±`¼Æ ­È ´y­z
  2. vbNormal 0 (¹w³]) «ü©w¨S¦³ÄݩʪºÀɮסC.
  3. VbReadOnly 1 °£µLÄݩʪºÀÉ®×¥~¡A¥t«ü©w°ßŪÀɮסC
  4. vbHidden 2 °£µLÄݩʪºÀÉ®×¥~¡A¥t«ü©wÁôÂÃÀɮסC
  5. vbSystem 4 °£µLÄݩʪºÀÉ®×¥~¡A¥t«ü©w¨t²ÎÀɮסC ¦bMacintosh ¤¤µLªk¨Ï¥Î¡C
  6. vbVolume 8 «ü©w¼ÐÅÒÀɮסF¦pªG«ü©w¤F¨ä¥¦ÄÝ©Ê¡AvbVolume ±N³Q©¿²¤¡C ¦bMacintosh¤¤µLªk¨Ï¥Î¡C
  7. vbDirectory 16 °£µLÄݩʪºÀÉ®×¥~¡A¥t«ü©w¸ô®|©ÎÀɮק¨¡C
  8. vbAlias 64 «ü©wªºÀɦW¬O§O¦W¡A¥u¦bMacintosh¤W¥i¥Î¡C
½Æ»s¥N½X
  1. Option Explicit
  2. Sub Ex()
  3.     Dim a, Ar()
  4.     a = Dir("d:\*.*", 2 + 4)
  5.     If a <> "" Then ReDim Preserve Ar(0): Ar(0) = a
  6.     Do While a <> ""
  7.         a = Dir
  8.         If a <> "" Then
  9.             ReDim Preserve Ar(UBound(Ar) + 1)
  10.             Ar(UBound(Ar)) = a
  11.         End If
  12.     Loop
  13.     If Join(Ar, vbLf) <> "" Then MsgBox Join(Ar, vbLf)
  14. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : §Ñ¥\¤£§Ñ¹L¡A§Ñ«è¤£§Ñ®¦¡C
ªð¦^¦Cªí ¤W¤@¥DÃD