@Nathan It's the same problem as swapping the value of two variables, you need a third temporary to hold one of the values: `t = a; a = b; b = t;` Just do something similar with the filenames: `File.Move("Employees.xlsx", "temp.xlsx"); File.Move("Student.xlsx", "Employees.xlsx"); File.Move("temp.xlsx", "Student.xlsx");`
– CoreyJan 16 '17 at 06:16
@Nathan Funny, works fine for me. "it didn't work" isn't descriptive enough. Why didn't it work? What went wrong? What error did you get? I'm going to guess that you've got one or both of the files open at the time, which is about the most common reason for move failure there is. Close the files and try again.
– CoreyJan 17 '17 at 00:21
@Corey I've tried it again today and it works.
Yeah I think yesterday it didnt work because my excel was still functioning when it wasn't even open. So I rewrote a few of the part of my codes and now it works perfectlyyy ! :D Thank you
– NathanJan 17 '17 at 00:39