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

[µo°Ý] ½Ð°Ý¦p¦ó§Q¥ÎÂsÄý¤§¸ê®Æ§¨¤è¦¡¡A©óÀx¦s®æ¥Í¦¨¦¹¸ô®|??

[µo°Ý] ½Ð°Ý¦p¦ó§Q¥ÎÂsÄý¤§¸ê®Æ§¨¤è¦¡¡A©óÀx¦s®æ¥Í¦¨¦¹¸ô®|??

½Ð°Ý¦p¦ó§Q¥ÎÂsÄý¸ê®Æ§¨¤è¦¡¡A±N«ü©wªº¸ê®Æ§¨¸ô®|¥´¦b«ü©wÀx¦s®æ¸Ì??
¨Ò¦p:§ÚÂIÀ»«ö¶s«á¿ï¾ÜD:\TEST\TEST001¦¹¸ô®|ªºTEST001¸ê®Æ§¨¡A
¦p¦óÅýÀx¦s®æA1¦Û°Ê¥´¤W­è­è¿ï¾Ü¸ê®Æ§¨ªº¸ô®|"D:\TEST\TEST001"
½Ð°Ý¦U¦ì¤j¤j¦¹¥¨¶°­n¦p¦ó¼g???

  1. Sub nn()
  2. With Application.FileDialog(msoFileDialogFolderPicker)
  3. .Show
  4. [A1] = .SelectedItems(1)
  5. End With
  6. End Sub
½Æ»s¥N½X
¦^´_ 1# ´Ñ»y³¾»ï
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 2# Hsieh


  
ªGµM§ÚÁÙ¬Oºò©³¤§µì~¤£ª¾­þ®É¤~¯à¹F¨ì¤j®vªº¹Ò¬É!·PÁÂH¤j...¼ö¤ßªº¦^ÂÐ...À°¤F§Ú«Ü¤jªº¦£!!

TOP

­è­è¬d¤F application.FileDialog ªº¥Îªk, ­ì¨Ó¬O³o­Ó·N«ä, §Ú¶¶«K§â¥¦ pass ¥X¨Ó

¦ÛExcel XP(2002)°_¡AApplication¦h¤F¤@­ÓFileDialogÄÝ©Ê¡CFileDialog ÄݩʶǦ^ FileDialog ª«¥ó¡A¦¹ª«¥ó¥NªíÀÉ®×¹ï¸Ü¤è¶ôªº°õ¦æ­ÓÅé¡C

¥Îªk¡G
Application.FileDialog(fileDialogType)
fileDialogType ¥²¿ïªº MsoFileDialogType¡CÀÉ®×¹ï¸Ü¤è¶ôªºÃþ«¬¡C
MsoFileDialogType ¥i¥H¬O³o¨Ç MsoFileDialogType ±`¼Æ¤§¤@¡C

   1. msoFileDialogFilePicker ¤¹³\¨Ï¥ÎªÌ¿ï¨úÀɮסC
   2. msoFileDialogFolderPicker ¤¹³\¨Ï¥ÎªÌ¿ï¨ú¸ê®Æ§¨¡C
   3. msoFileDialogOpen ¤¹³\¨Ï¥ÎªÌ¶}±ÒÀɮסC
   4. msoFileDialogSaveAs ¤¹³\¨Ï¥ÎªÌÀx¦sÀɮסC

FileDialog ª«¥ó´£¨ÑÀÉ®×¹ï¸Ü¤è¶ô¥\¯à¡AÃþ¦ü Microsoft Office À³¥Îµ{¦¡¤¤ªº¼Ð·Ç [¶}±ÒÂÂÀÉ] ¤Î [Àx¦sÀÉ®×] ¹ï¸Ü¤è¶ô¥\¯à¡C¹B¥Î³o¨Ç¹ï¸Ü¤è¶ô¡A¾ã¦X¤è®×ªº¨Ï¥ÎªÌ¥i¥H«Ü®e©ö¦a«ü©w¸Ó¤è®×À³¨Ï¥ÎªºÀɮפθê®Æ§¨¡C

¨Ï¥Î FileDialog ª«¥ó
¥H FileDialog ÄݩʶǦ^ FileDialog ª«¥ó¡CFileDialog Äݩʦì¦b¨C­Ó³æ¿Wªº Office À³¥Îµ{¦¡ Application ª«¥ó¤¤¡CÄݩʨϥΤ@­Ó¤Þ¼Æ DialogType¡A¥H½T©wÄݩʩҶǦ^ªº FileDialog ª«¥óÃþ«¬¡C¤U¦C¬O FileDialog ª«¥óªº 4 ºØÃþ«¬¡G

   1. [¶}±ÒÂÂÀÉ] ¹ï¸Ü¤è¶ô¡GÅý¨Ï¥ÎªÌ¿ï¨ú¤@©Î¦h­ÓÀɮסA¥i¨Ï¥Î Execute ¤èªk¦b¥DÀ³¥Îµ{¦¡¤¤¶}±Ò¡C
   2. [¥t¦s·sÀÉ] ¹ï¸Ü¤è¶ô¡GÅý¨Ï¥ÎªÌ¿ï¨ú¤@­ÓÀɮסA¥i¨Ï¥Î Execute ¤èªkÀx¦s¥Ø«eªºÀɮסC
   3. [Àɮ׿ï¾Ü¾¹] ¹ï¸Ü¤è¶ô¡GÅý¨Ï¥ÎªÌ¿ï¨ú¤@©Î¦h­ÓÀɮסC¦b FileDialogSelectedItems ¶°¦X¤¤Â^¨ú¨Ï¥ÎªÌ©Ò¿ï¨úªºÀɮ׸ô®|¡C
   4. [¸ê®Æ§¨¿ï¾Ü¾¹] ¹ï¸Ü¤è¶ô¡GÅý¨Ï¥ÎªÌ¿ï¨ú¸ô®|¡C¦b FileDialogSelectedItems ¶°¦X¤¤Â^¨ú¨Ï¥ÎªÌ©Ò¿ï¨úªº¸ô®|¡C

¨C­Ó¥DÀ³¥Îµ{¦¡¥u¯à¨Ò¥Ü FileDialog ª«¥óªº³æ­Ó¹ê¨Ò¡C¦]¦¹¡A§Y¨Ï·í«Ø¥ß¦h­Ó FileDialog ª«¥ó®É¡A¥ç«O¯d FileDialog ª«¥óªº³\¦hÄÝ©Ê¡C¦]¦¹¡A½Ð½T»{¦bÅã¥Ü¸Ó¹ï¸Ü¤è¶ô«e¡A¤w³]©w¾A¦X±z¥Øªº¤§©Ò¦³ÄÝ©Ê¡C

¬°¤F¨Ï¥Î FileDialog ª«¥óÅã¥Ü¹ï¸Ü¤è¶ô¡A±z¥²¶·¨Ï¥Î Show ¤èªk¡C¤@¥¹Åã¥Ü¹ï¸Ü¤è¶ô¡A´N·|¦b¨Ï¥ÎªÌµ²§ô¸Ó¹ï¸Ü¤è¶ô¤§«á¤~°õ¦æµ{¦¡½X¡C
Homeman

TOP

        ÀR«ä¦Û¦b : ¦³¦h¤Ö¤O¶q´N°µ¦h¤Ö¨Æ¡A¤£­n¤ß¦sµ¥«Ý¡Aµ¥«Ý¤~·|¸¨ªÅ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD