excel vba - Kill macro returns a 53 error -


this macro returns 53 error.

if use csvpath2 variable kill command macro works, if use sprocessfile variable not.

sub delete() dim csvpath string dim csvpath2 string dim sprocessfile string  csvpath = "c:\test\" 'csvpath2 = "c:\test\*.csv" sprocessfile = dir(csvpath & "*.csv")  kill sprocessfile  end sub 

you need complete filespec (including path)

on machine:

sub delete()    dim csvpath string    dim sprocessfile string     csvpath = "c:\testfolder\"    sprocessfile = dir(csvpath & "*.csv")    kill csvpath & sprocessfile end sub 

Comments

Popular posts from this blog

Capture and play voice with Asterisk ARI -

c++ - Can not find the "fiostream.h" file -

visual studio - Installing Packages through Nuget - "Central Directory corrupt" -