In order to keep users from stepping on each other while using the file we've created, we use a Auto_Open macro to immediately save the file to a safe location in the users' home directory. The goal is to minimize user input as much as possible so I placed a Kill command ahead of the SaveAs command to erase the file before saving a new copy. This eliminates the pesky "File Already Exists" alert window....again the goal is to keep the users hands off and not ask them to click or touch anything until the process is ready for them. It worked great on the first test because the Excel file in my home directory already existed and the Kill command deleted it. But when I tried it on a new user's machine, one where the Excel file did not exist in his home directory, it crashed on the kill command statement.
Is there a way to override this or will I have to check for the existence of the xls file before executing the kill statement? And if so, how does one efficiently do that? In doing research on this it sounds like a method to have the SaveAs command automatically overwrite the existing file would be preferred. The code I just examined to check for the presence of a file was lengthy and complex.
Bookmarks