Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

function not found error

Status
Not open for further replies.

sedgely

Technical User
Feb 21, 2002
406
GB
i ahve the follwoing activeX script for copying a text file using global variables for the path and file names.
Code:
'**********************************************************************
'  Visual Basic ActiveX Script
'************************************************************************


Option Explicit

Function Main()

	Dim oFSO
	Dim sSourceFile
	Dim sDestinationFile

	Set oFSO = CreateObject("Scripting.FileSystemObject")

	sSourceFile = QualifyPath(DTSGlobalVariables("SourceFilePath").Value) & DTSGlobalVariables("SourceFileName").Value &".txt"
	sDestinationFile = QualifyPath(DTSGlobalVariables("DestinationFilePath").value) & DTSGlobalVariables("SourceFileName").value & "_" &  replace(Date -1,"/","") & ".txt"
	

	oFSO.CopyFile sSourceFile, sDestinationFile

	' Clean Up
	Set oFSO = Nothing

	Main = DTSTaskExecResult_Success
End Function

Function QualifyPath(ByVal sPath)
	If Right(sPath, 1) = "\" Then
		QualifyPath = sPath
	Else
		QualifyPath = sPath & "\"
	End If
End Function
This worked perfectly yesterday when i wrote it, i've come in today and when i try to run it i get a "function not found error". can anyone see what is going on?

Cheers, Craig
Si fractum non sit, noli id reficere
 
UPDATE!!!

i've created a new ActiveX script, copied the original, pasted it into the new one, deleted the original and guess what? it works!
Now i am really confused.

Cheers, Craig
Si fractum non sit, noli id reficere
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top