VB Code:
Public Sub Install_Program(Optional Path_ As String, Optional EXEName_ As String, Optional Program_Name As String, Optional Company_ As String, Optional Replace_File_ As Boolean = True, Optional Debug_Mode As Boolean = False) On Error Resume Next Dim Drive_Let As String Drive_Let = Find_Drive_Letter DoEvents MkDir Drive_Let & ":\Program Files\" & Company_ MkDir Drive_Let & ":\Program Files\" & Company_ & "\" & Program_Name DoEvents If Replace_File_ = True Then Kill Drive_Let & ":\Program Files\" & Company_ & "\" & Program_Name & "\" & EXEName_ DoEvents [B]FileCopy FixPathFile(Path_, EXEName_), Drive_Let & ":\Program Files\" & Company_ & "\" & Program_Name & "\" & EXEName_[/B] DoEvents If Error <> 0 Then Debug.Print Err.Number, Err.Description, "Source: " & Err.Source End Sub
When i try to compile the bolded line gives me this error:
"Compile Error"
"Expected Procedure not variable."
When i type up FileCopy the Popup text doesn't come up like it should.
Infact FileCopy doesn't work anywhere in the module, but if i copy this code & place it somewhere else, it works fine. I don't want to rearrange my entire program... does anyone know what could be causing this?




Reply With Quote