在filecopy语句中,如何使用变量
例如:
FileCopy "d:\001.xls", "d:\002.xls"
我先定义aa="001",那在filecopy语句中如何用aa代替001

解决方案 »

  1.   

    FileCopy "d:\001.xls", "d:\002.xls"
    FileCopy "d:\" & aa & ".xls", "d:\002.xls"
      

  2.   

    Option ExplicitPrivate Sub Form_Load()
    Dim aa As String
    aa = "001"
    FileCopy "d:\" & aa & ".xls", "d:\002.xls"
    End Sub
      

  3.   

    public sub cfile(byval aa as string )
     FileCopy "d:\" & aa & ".xls", "d:\002.xls"
    end sub
      

  4.   

    Dim aa As String
    aa = "001"
    FileCopy "d:\" & aa & ".xls", "d:\002.xls"
      

  5.   

    public sub cf(byval ipath as string,byval copyto as string)
     FileCopy  ipath ,copyto 
    end sub