ªð¦^¦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

¦^´_ 1# maiko
  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 = .SelectedItems(1)  '#1
  8.     Else
  9.         End
  10.     End If
  11. End With
  12. Sheet1.Range("F2") = FileFolder  '#2
  13. End Sub
½Æ»s¥N½X
InitialFileName¥u¬O§A¶}±ÒDialog®É¤@¶}©lªº¦ì¸m

TOP

¦^´_  maiko InitialFileName¥u¬O§A¶}±ÒDialog®É¤@¶}©lªº¦ì¸m
stillfish00 µoªí©ó 2012-10-9 14:21



   

¦³­Ó¤p°ÝÃD¡G
±o¨ìªº¸ô®|¬O¡G
d:\SaveExcel\20121009
¨Ã¤£¬O¡G
d:\SaveExcel\20121009\
¤Ö¤F­Ó¡u\¡v²Å¸¹¡C

TOP

¦^´_ 1# maiko
2# »¡ InitialFileName¥u¬O§A¶}±ÒDialog®É¤@¶}©lªº¦ì¸m
¹w³]¦p¹Ï

  1. Option Explicit
  2. Sub Ex() ' 2003, 2007 ¤À§O°õ¦æ¬Ý¬Ý¦³µL®t§O
  3.     MsgBox Application.DefaultFilePath
  4. End Sub
½Æ»s¥N½X

TOP

¦^´_  maiko
2# »¡ InitialFileName¥u¬O§A¶}±ÒDialog®É¤@¶}©lªº¦ì¸m
¹w³]¦p¹Ï
GBKEE µoªí©ó 2012-10-9 15:33



   

1. §Aªº·N«ä¬O¤£¬O»¡¦b¿ï¶µ¤¤ªº¡u¹w³]Àɮצì¸m¡v¨S¦³¡u\¡v¡A¨º»ò¨ú±oªº¸ô®|³Ì«á­±´N¨S¦³¡u\¡v¡H

2. ÁÙ¬O»¡InitialFileName¥u¬O¶}±ÒDialog®É¤@¶}©lªº¦ì¸m ´N¬O¡u¹w³]Àɮצì¸m¡v¡H

¦pªG¬O1.ªº¸Ü¡A¨º»ò§Ú¦bWinXP + Excel 2007¡A¥ÎInitialFileName´N¥i¥H±o¨ì§¹¾ãªº¸ô®|¡A¦p¡Gd:\SaveExcel\20121009\
¦pªG¬O2.ªº¸Ü¡A¦]¬°¦b¶}±ÒDialog®É¤w¸g§ïÅܤFÀɮצì¸m¡A©Ò¥H«ö¤F½T©w¥H«á©Ò±o¨ìªº¸ô®|¤w¸g¤£¬O¡u¹w³]Àɮצì¸m¡vªº¸ô®|¡C

©¿µM¡A§Ú±o¨ì¤F¤@­Ó¦n¹³¸òWindows¦³Ãöªº°ÝÃD¡A´N¬O¡G
¥ÎWin7 + Excel 2007ªº¸Ü¡A¥Î.InitialFileName¨ú¨ìªº¸ô®|´N·|¤Ö¤@¼h¡F
¥ÎWinXP + Excel 2007ªº¸Ü¡A¥Î.InitialFileName¨ú¨ìªº¸ô®|´N«Ü§¹¾ã¡C
·íµMExcel 2003¦b­þ­ÓWindows³£¨S¦³°ÝÃD¡C

¤£ª¾¹D³o­Ó¬O¤£¬OWindows¥»¨­ªºFileDialog¤¶­±¤£¦P©Ò±o¨ìªº¸ô®|¤£¦P¡H
³o­Ó¬OWinXP + Excel 2007Â^¨úªºFileDialog¤¶­±¡G


Win7 + Excel 2007¼È®ÉÂ^¨ú¤£¨ì¡Aµ¥¤U¦A¸É¤W¡C

TOP

½Ð¦U¦ì°ª¤â¥Î¥N½X¸Õ¸Õ¬Ý¡A­þ¸Ì¥X¿ù¤F¡H¦³¤°»ò¦a¤è­n§ï¶i¡HÁÂÁ¡I

TOP

¦^´_ 5# maiko
1#°Ý»¡:  2003  d:\SaveExcel\20121009 ¥i¬O¦b2007®É®³¨ìªº¸ô®|¬O¡Gd:\SaveExcel\
§Úªº¦^ÂÐ ¬O«ü¥X¥i¯à¬O Application.DefaultFilePath   2003,2007 ªº¡u¹w³]Àɮצì¸m¡v ¸ô®|¤£¦P
§A°Ý :      InitialFileName¥u¬O¶}±ÒDialog®É¤@¶}©lªº¦ì¸m ´N¬O¡u¹w³]Àɮצì¸m¡v
                ©Ò¥H¦b¶}±ÒDialog®É¤w¸g§ïÅܤFÀɮצì¸m¡A©Ò¥H«ö¤F½T©w¥H«á©Ò±o¨ìªº¸ô®|¤w¸g¤£¬O¡u¹w³]Àɮצì¸m¡vªº¸ô®|¡C
¬O¹ïªº
  1. Sub Ex()
  2.     Application.DefaultFilePath = "D:\TEST"
  3.     '¥i­×§ï¡u¹w³]Àɮצì¸m¡v
  4. End Sub
½Æ»s¥N½X

TOP

¦^´_  maiko
1#°Ý»¡:  2003  d:\SaveExcel\20121009 ¥i¬O¦b2007®É®³¨ìªº¸ô®|¬O¡Gd:\SaveExcel\
§Úªº¦^ÂÐ ...
GBKEE µoªí©ó 2012-10-9 17:16



   
§A»~·|¤F§Úªº·N«ä¤F¡A§Ú¨Ã¤£¬O­n¡u¹w³]Àɮצì¸m¡v©ÎªÌ­n§ïÅÜ¡u¹w³]Àɮצì¸m¡v¡A§Ú¬O·Q³q¹L¿ï¾ÜÀɮ׸ô®|µM«áµ¹¥X§¹¾ãªº¸ô®|¦r¦ê¡A¦p¡Gd:\SaveExcel\20121009\¡A³o¼Ëªº¦r¦ê¡A¦Ó§Ú¦b2003®É¡A¨Ï¥ÎInitialFileName¬O¥i¥H§¹¾ãªº¨ú±oÀɮ׸ô®|¡Gd:\SaveExcel\20121009\¡A¦Ó¦b2007®É¡A¨Ï¥ÎInitialFileName´N¥u¯à¨ú±o¡Gd:\SaveExcel\¡A´N¬O®t¤F¤@¼h¸ô®|¡C

¦Ó§Ú¥Îstillfish00¤j´£¨Ñªº¨ú±oªºÀɮ׸ô®|«o¬O¡Gd:\SaveExcel\20101009¡A«á­±¤Ö¤F¡u\¡v³o­Ó¡A¥¿¬O³o¼Ëªº§xÂZ¤~°Ý³o¸Ìªº°ª¤â¬Ý¬Ý¦³¤°»ò¤èªk¸Ñ¨M§¹¾ã¸ô®|¦r¦êªº°ÝÃD¡AÁÂÁ¡I

½Ð¥Î¥N½X¦bExcel¤W¸Õ¸Õ¡CÁÂÁ¡I

TOP

¸É¤W¦bWin7 + Excel 2007ªº FileDialog ¤¶­±


³o¬OWinXP + Excel 2007 ªº FileDialog ¤¶­±


°ÝÃD·|¤£·|¥X¦b¨â­Ó¤¶­±©Ò±oªº¸ô®|¤£¦P¡A¥i¯à¤w¸g¤£¬O¥ÎInitialFileName¡A¤]¤£¬O¥ÎSelectedItems(1)©Ò¯à¨ú±oªº¸ô®|¤F¡A¬O¤£¬OÁÙ¦³¨ä¥¦ªº¤èªk¨ú±o³o¼Ëªº¸ô®|©O¡HÁÂÁ¡I

TOP

¦^´_ 5# maiko
Hi , §Ú®a¬Owin7+Excel2010 ,

§Ú¤S¸Õ¤F¤@¹M , ½T¹ê .InitialFileName ¤]·|ÀH¨Ï¥ÎªÌ¾Þ§@«á§ïÅܸô®| , ¥u¬O·íªì¨S·Q¨ìÁÙ¯à³o¼Ë°µ¬°¦^¶Çµ²ªG , ¦ý¦pªG¨S¯S®í»Ý¨D§ÚÁÙ¬O·|¥Î .SelectedItems¨ú¦^µ²ªG°Õ , ¤Ö­Ó±×½u´N¥Î²Â¤èªk & "\" ¦Û¤v¥[¤W¥h:L

µM«áwin7+Excel2010¤U , ¨Ï¥Î .InitialFileName¤]¸ò§A¤@¼Ë¤Ö¤@¼h , ¦ý¸òApplication.DefaultFilePath¤£¤@­P , ¤Ï¦Ó¬O¸òcurDir¤@­P , ¨Ñ±z°Ñ¦Ò

TOP

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