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

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -