excel vba - RunTime Error 53 : File Not Found -



excel vba - RunTime Error 53 : File Not Found -

an error thrown line:

set fileobj = ofs.getfile( ... )

the error runtime error 53 : file not found error when run macro in excel 2007 vba update .txt file based in sharepoint site.

here total code:

sub logreport(reportname string) 'call appendtxt("//myaviall/teamsites/aviallreportingsolutions/airplane_usage_log/airplane_act.txt", unamewindows & ";" & reportname & ";" & & ";" & versionnum) dim ofs, ts, fileobj 'get text stream set ofs = createobject("scripting.filesystemobject") set fileobj = ofs.getfile("//myaviall/teamsites/aviallreportingsolutions/airplane_usage_log/airplane_act.txt") set ts = fileobj.openastextstream(8, -2) 'forwriting, tristateusedefault) ' write file ts.writeline unamewindows & ";" & reportname & ";" & & ";" & versionnum ts.close set ts = nil set fileobj = nil set ofs = nil end sub function appendtxt(sfile string, stext string) on error goto err_handler dim filenumber integer filenumber = freefile ' unused file number open sfile append #filenumber ' connect file print #filenumber, stext ' append our string close #filenumber ' close file exit_err_handler: exit function err_handler: msgbox "the next error has occured" & vbcrlf & vbcrlf & _ "error number: " & err.number & vbcrlf & _ "error source: appendtxt" & vbcrlf & _ "error description: " & err.description, vbcritical, "an error has occured!" goto exit_err_handler end function

excel-vba

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -