hi, im having 2 Excel files, one is the database file and the other is a user interface file. Users will then use the interface file to input data and click save, and then the interface file will save the data into the database file.

i need to a way to ensure that there is no concurrent writing to the database file, is there a way to have mutual exclusive access? or perphaps a way to catch the error if the file is already opened?

For example, if the adminstrator has directly opened the database file (without using the interface file), any user who clicks save will then be prompted that the file is being used. Or if the 2 users are writing at the same time then only one of them will be granted access.

im currently using this code to read and write from Excel files,

Set xlapp = New Excel.Application
Set wb = xlapp.Workbooks.Open({FileName}, 2, False, 5, _
{password}, {password})

and with this method, if the administrator has directly opened the database file, as soon as the user click save, a new copy of the database file will be created and saved in the Excel default file location, which then the actual database file will not be updated.

i do not wish to use ms access because it can be very slow.

can anyone help me out? Thank you.