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

Excel 2003¿ý»sªº¥¨¶°¡A¦bExcel2007¸Ó¦p¦ó­×§ï

Excel 2003¿ý»sªº¥¨¶°¡A¦bExcel2007¸Ó¦p¦ó­×§ï

¥»©«³Ì«á¥Ñ acdx ©ó 2012-5-17 15:25 ½s¿è

Dim mybtm As Integer
        mypath = ActiveWorkbook.Path
  
      Set fs = Application.FileSearch
   With fs
    .LookIn = mypath
    .Filename = "zzz_results.xls"

    If .Execute = 1 Then

        mymsg = "zzz_results.xls exist, Overwrite it ?"
        mytitle = " WARNING"
               
        mybtn = MsgBox(mymsg, vbYesNo + vbExclamation, mytitle)
        
        If mybtn = vbNo Then GoTo 40
        
        Else
         Workbooks.Add
         ActiveWorkbook.SaveAs Filename:=mypath & "\" & "zzz_results.xls"
         
        End If
                     
        Workbooks.Open Filename:=mypath & "\" & "zzz_results.xls"
        Cells.ClearContents
        ActiveWorkbook.Save
  
        End With

¦^´_ 1# acdx


    mypath = ThisWorkbook.Path & "\"
fs = Dir(mypath & "zzz_results.xls")
If fs = "" Then
   Workbooks.Add
   ActiveWorkbook.SaveAs Filename:=mypath & "\" & "zzz_results.xls"
Else
       mymsg = "zzz_results.xls exist, Overwrite it ?"
        mytitle = " WARNING"
               
        mybtn = MsgBox(mymsg, vbYesNo + vbExclamation, mytitle)
        
        If mybtn = vbNo Then GoTo 40
End If
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 2# Hsieh

Set myFSObj = Application.FileSearch

With myFSObj
  .LookIn = ActiveWorkbook.Path
  .Filename = "*.xls"
  If .Execute(SortBy:=msoSortByFileName, sortorder:=msoSortOrderAscending) > 0 Then
  For i = 1 To .FoundFiles.Count
  wkfile = .FoundFiles(i)
  resultfile = mypath & "\" & "zzz_results.xls"
  If resultfile = .FoundFiles(i) And i = .FoundFiles.Count Then GoTo 20
  If resultfile = .FoundFiles(i) Then GoTo 30
  Workbooks.Open Filename:=wkfile
­Y¬O³o¼Ë¸Ó¦p¦ó§ï©O?

TOP

        ÀR«ä¦Û¦b : ¦Y­W¤F­W¡B­WºÉ¤Ü¨Ó¡A¨ÉºÖ¤FºÖ¡BºÖºÉ´d¨Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD