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

[µo°Ý] EXCEL 2007 VBA ¦bEXCEL 2010 °õ¦æ¥X°ÝÃD

¦^´_ 9# GBKEE


ª©¤j§ÚÁÙ¦³¤@°Ý·Q½Ð±Ð¡A¤£ª¾¯à§_À°¦£
  1. Sub w_report_Click()

  2.     '-----¶}±ÒWªí³æ-----
  3.    
  4.     Dim program_file As String, filename As String, w_file As String
  5.    
  6.     program_file = Left(ActiveWorkbook.Name, Application.Find(".", ActiveWorkbook.Name) - 1)
  7.     filename = Application.GetOpenFilename
  8.    
  9. '    On Error Resume Next
  10. '    On Error GoTo HandleErr

  11.     Workbooks.Open filename

  12.     w_file = Dir(filename)
  13.     Debug.Print w_file

  14.     A w_file
  15.     A_chart w_file
  16.     F w_file
  17.    
  18.     Workbooks(program_file).Worksheets(1).w_file = ""
  19.     MsgBox "DONE !!!"
  20.    
  21. '    Exit Sub
  22. '
  23. 'HandleErr:
  24. '        MsgBox "½Ð¶}±ÒWªí³æ¡C"
  25.         
  26. End Sub
½Æ»s¥N½X
«È¤á°õ¦æ®Éµo²{¥X¿ù¦b³o¦æ
w_file = Dir(filename)
¥D­n¬O¥Î¨Ó§ì¶}±ÒªºÀɮצWºÙ

«á¨Ó§Ú¥Î­ÓÀx¦s®æ©ñÀɦWÅý¥L´ú¸Õ
EX:
w_file = range("A1")   ->Àx¦s®æA1¨Ó©ñÀɦW
³o¼Ë´N¥i¥H¤F

¤£ª¾¬O¤£¬ODir¤£¯à¨Ï¥Î

½Ð°Ý¦³¤°»ò¥t¥~¥i¥H§ì¨ìÀɦWªº¤èªk¶Ü???


®@~¦Ó¥B³Ì«á½T»{
«È¤á¥ÎEXCEL2010­^¤åª©ªº¡A¤@¼Ë­n¹³ª©¤j»¡ªº¥[¤W°ÆÀɦW¤~¦æ

·PÁÂ!!!!
¥Î¥\¨ì¥@¬É¥½¤é¨º¤@¤Ñ¡ã¡ã¡ã

TOP

¦^´_ 11# li_hsien
  1. MsgBox filename   '¦³°ÆÀɦWªº
  2. 'Dir ¨ç¼Æ »yªk Dir [(pathname[, attributes])]
  3. w_file = Dir(filename, vbNormal)  '¥[ attributes³o°Ñ¼Æ¸Õ¸Õ¬Ý
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 12# GBKEE

ÁÂÁª©¤j

µ²ªG«È¤á¨ºÃäÁÙ¬O¤£¦æ

¦n¹³¬ODir³£¤£ºÞ¥Î@@

µ²ªG§Ú·Q¨ì¤ñ¸ûª½Æ[ªº¤èªk

Workbooks.Open filename
w_file = ActiveWorkbook.Name

Åý¨Ó·½Àɶ}°_¨Óªº®É­Ô
¦A±µ¤@¦¸ActiveWorkbook.Name

ÁöµM¦n¹³²Â¤FÂI

¦ý¬O¥i¦æ  «¢«¢
¥Î¥\¨ì¥@¬É¥½¤é¨º¤@¤Ñ¡ã¡ã¡ã

TOP

        ÀR«ä¦Û¦b : ¡i»X½ªªº¦Û¥Ñ¡j¤H±`¦b¤°»ò³£¥i¥H¦Û¥Ñ¦Û¦bªº®É­Ô¡A«o³Q³oºØÀH¤ß©Ò±ýªº¦Û¥Ñ»X½ª¡AµêÂY®É¥ú¦Ó²@µLıª¾¡C
ªð¦^¦Cªí ¤W¤@¥DÃD