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

[µo°Ý] 2003»P2007±o¨ìªº¸ô®|®t²§

[µo°Ý] 2003»P2007±o¨ìªº¸ô®|®t²§

  1. Sub OpenPath()
  2. Dim fd As FileDialog, FileName As String, FileFolder As String
  3. Set fd = Application.FileDialog(msoFileDialogFolderPicker)
  4. With fd
  5.     .AllowMultiSelect = False
  6.     If .Show = -1 Then
  7.         FileFolder = .InitialFileName
  8.     Else
  9.         End
  10.     End If
  11. End With
  12. Sheet1.Range("F2") = fd.InitialFileName
  13. End Sub
½Æ»s¥N½X
¦b2003®É¥i¥H§¹¥þªº®³¨ì¸ô®|¡A¥i¬O¦b2007®É´N¥u¯à®³¨ì·í«e¸ô®|ªº¤W¤@¼h¡A½Ð°Ý­þ¸Ì¥X¿ù¤F¡H
¨Ò¦p¡G
¦b2003®É®³¨ìªº¸ô®|¬O¡G
d:\SaveExcel\20121009
¥i¬O¦b2007®É®³¨ìªº¸ô®|¬O¡G
d:\SaveExcel\
´N®t³o»ò¤@¼h¡C

¦^´_ 21# Happkkevin


   

ªº½T¦p§A©Ò»¡ªº¨º¼Ë¡A2003¿ï¨ú«á¤U¦¸¶}±Ò¬O¤£·|¸õ¦^¤W¤@¼hªº¡A©Ò¥H§Ú»¡´N¬O¨âºØª©¥»ªºFileDialogªº®t²§¡A¥¿¦bµ¥«Ý°ª¤â¦p¦ó¸Ñ¨M¡AÁÂÁ¡I

TOP

¦^´_ 19# maiko

InitialFileName  ·|³]©w©Î¶Ç¦^ String¡A¦¹¦r¦ê¥Nªí³ÌªìÅã¥Ü¦bÀÉ®×¹ï¸Ü¤è¶ô¤¤ªº¸ô®|©ÎÀɦW¡C¥iŪ¼gªº¡C
SelectedItems  ·|¨ú±o FileDialogSelectedItems ¶°¦X¡C³o­Ó¶°¦X¥]§t¨Ï¥ÎªÌ¦b¨Ï¥Î FileDialog ª«¥óªº Show ¤èªk©ÒÅã¥ÜªºÀÉ®×¹ï¸Ü¤è¶ô¤¤¿ï¨ú¤§Àɮתº¸ô®|²M³æ¡C°ßŪªº¡C

³æ¯Â´ú¸Õ¦^³ø
¦pªG¨Ì·Ó§Ú¥H2010ª©©Î§A¨Ï¥Îªº2007ª©¡A¦p§Ú¤W­±¦^Âбԭz¡A¤U¦¸¿ï¨ú®É¬°¸õ¨ì¥Ø¿ý¬°¿ï¨ú®Éªº¤W¤@¼h§Y d:\SaveExcel¡A©Ò¥H¨ú±oªº fd.InitialFileNameÁÙ¬Od:\SaveExcel\
¦Ó¨Ï¥ÎSelectedItems ¤~·|¬O¿ï¨úªºd:\SaveExcel\20121009¡A¥i¥H¸Õ¸Õ2003ª©¬O§_¿ï¨ú«á¤U¦¸¶}±Ò¬O§_¤£·|¸õ¦^¤W¤@¼h¡A­Y¬O¦p¦¹¡AÀ³¸Ó¬O¨âºØª©¥» ¤§FileDialog®t²§
³o´N»Ý­n°ª¤â­Ì¨ó§U¤F
100 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¦^´_ 19# maiko
¥i¬OInitialFileName¦pªG¥Î¦b2007¤W«o¬O±o¨ìªº¸ô®|·|¤Ö¤F¤@¼h
§Ú¥u¦³2003ª© ©Ò¥H³o®t²§§ÚµL±q°Ñ»Pªº.

TOP

¦^´_  maiko
GBKEE µoªí©ó 2012-10-10 12:42



   
ÁÂÁ¤j¤jªº¼ö¤ßÀ°¦£¡A¤£¹L¤j¤j¦n¹³¤£©ú¥Õ§Ú«e­±©ÒÁ¿ªº­n¨D¡G

InitialFileName¦pªG¥Î¦b2003¤W¬O§¹¥þ¥i¥H¨ú±o§¹¾ãªº¸ô®|¡A¦p¡Gd:\SaveExcel\20121009\
¥i¬OInitialFileName¦pªG¥Î¦b2007¤W«o¬O±o¨ìªº¸ô®|·|¤Ö¤F¤@¼h¡A¦p¡Gd:\SaveExcel\¡A³o¤]´N¬O§A»¡ªº«á­±¦³"\"¡A¥i¬O¸ô®|¤£§¹¾ã¡C

¦pªG¥ÎSelectedItems(1)¡A¨º»ò¦b2003©Î2007¡]¦]¬°§Ú¨S¦³2010¡A¥i¬O¤§«e¦³¤j¤j¦b2010¤W¸Õ¹L¡^¬O¥i¥H¨ú±o¨ì¤ñ¸û§¹¾ãªº¸ô®|¡A¦p¡Gd:\SaveExcel\20121009¡A«á­±´N¨S¦³"\"¡A´N¦pstillfish00¤j»¡¹Lªº¨º¼Ë¡A°ß¦³¦Û¤v¥[¤W& "\"¡A¤£ª¾¹D³o¼Ë»¡©ú§A¯à²M·¡¶Ü¡H

½Ð¸Õ¦h´X¦¸¥N½Xªº°Ï§O¡AÁÂÁ¤j¤jªº¼ö¤ßÀ°¦£¡I

TOP

¦^´_ 17# maiko
  1. Option Explicit
  2. Sub OpenPath()
  3. Dim fd As FileDialog, FileName As String, FileFolder As String
  4. Set fd = Application.FileDialog(msoFileDialogFolderPicker)
  5. With fd
  6.      .InitialFileName = "E:\"  '«ü©w¹ï¸Üµøµ¡ªº¥Ø¿ý
  7.      .AllowMultiSelect = False
  8.     If .Show = -1 Then
  9.         FileFolder = .SelectedItems(1)   '¿ï¾Üªº¸ê®Æ§¨
  10.         [F2] = .SelectedItems(1)      '³Ì«á¨S"\"
  11.         [F3] = fd.InitialFileName    '¦³"\"
  12.     Else
  13.         End
  14.     End If
  15. End With
  16. End Sub
½Æ»s¥N½X

TOP

¦^´_  maiko
«Ü©êºp¨S»¡²M·¡ ½Ð¦A¬Ý  2# ªºµ{¦¡½X ¦³ FileFolder = .SelectedItems(1)   
stillfish00 2 ...
GBKEE µoªí©ó 2012-10-10 08:28



   

¨º»ò¨Ì§A©Ò¨£¡A¬O¤£¬OSheet1.Range("F2") = FileFolder ³Ì«á¬O¨S¦³¡u\¡v¡A¨º»òÀ³¸Ó¥Î¤°»ò¤~·|¦³¡u\¡v¡H¤£¥Î«á­±¦Û¤v¥[& "\"¡H

TOP

¦^´_ 15# maiko
«Ü©êºp¨S»¡²M·¡ ½Ð¦A¬Ý  2# ªºµ{¦¡½X ¦³ FileFolder = .SelectedItems(1)   
stillfish00 2# ¬O Sheet1.Range("F2") = FileFolder ¬O³Ì«á¨S¦³ "\"

TOP

¦^´_  maiko
¦Ó§Ú¥Îstillfish00¤j´£¨Ñªº¨ú±oªºÀɮ׸ô®|«o¬O¡Gd:\SaveExcel\20101009¡A«á­±¤Ö¤F¡u\¡v      ...
GBKEE µoªí©ó 2012-10-10 07:37



   

FileFolder = .InitialFileName
¤]´N¬O¡G
FileFolder = fd.InitialFileName
¹ïµ¥¤½¦¡¡C
¸Õ¹L¤F¡Aµ²ªG¤@¼Ë¡A°ß¦³¹³ stillfish00 ¤j»¡ªº¤@¼Ë¡A¦b«á­±¥[¤W & "\" ¡A¨º»òµL½×¬Æ»òª©¥»ªºExcel³£¥i¥H¥Î¨ì¡A²Î¤@¼Ë¦¡¡A¤£·|Åý¥H«á§ï¤Fª©¥»´N¥Î¤£¨ì¡C

ÁÂÁ³o»ò¦h¦ì°ª¤âªºÀ°§U¡AÅý§Ú§ó¤F¸Ñ¤FFileDialogªºÄÝ©Ê¡AÁÂÁ¡I

TOP

¦^´_ 8# maiko
¦Ó§Ú¥Îstillfish00¤j´£¨Ñªº¨ú±oªºÀɮ׸ô®|«o¬O¡Gd:\SaveExcel\20101009¡A«á­±¤Ö¤F¡u\¡v           
¤£¤@¼Ëªº  1# ¬O Sheet1.Range("F2") = fd.InitialFileName
stillfish00 2# ¬O Sheet1.Range("F2") = FileFolder

TOP

        ÀR«ä¦Û¦b : ¤£­nÀH¤ß©Ò±ý¡A­nÀH¤ß±Ð¨|¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD