Hi,
I'm trying to delete a file that uses the user's windows login id as a variable in the file name but am having a little trouble. I think I'm nearly there... I've assigned the windows login ID to the string User_FX with a function and have written the following code, but it returns an error message stating that there are invalid property property assignments or a wrong number of arguments. I'm sure this is obvious to the more educated but I have tried numerous permutations to no avail.
Sub Killfilewithuservariable()
If FileFolderExists("C:\Options\G_Reports\G_Reports_" & User_FX, ,".xlsx") Then
Kill "C:\Options\G_Reports\G_Reports_" & User_FX, ,".xlsx"
Else
End If
End sub
Any help would be much appreciated.
B666.
I'm trying to delete a file that uses the user's windows login id as a variable in the file name but am having a little trouble. I think I'm nearly there... I've assigned the windows login ID to the string User_FX with a function and have written the following code, but it returns an error message stating that there are invalid property property assignments or a wrong number of arguments. I'm sure this is obvious to the more educated but I have tried numerous permutations to no avail.
Sub Killfilewithuservariable()
If FileFolderExists("C:\Options\G_Reports\G_Reports_" & User_FX, ,".xlsx") Then
Kill "C:\Options\G_Reports\G_Reports_" & User_FX, ,".xlsx"
Else
End If
End sub
Any help would be much appreciated.
B666.