Two files: a xlsm file with VBA code (filename: XYZ_application.xlsm), another xlsx file (filename: output.xlsx)
There are around 20 employees in the team.
XYZ_application.xlsm opens an input excel file, and also opens output.xlsx, then pull some data from the input excel file to output.xlsx, then uses another program (non VBA program) to import output.xlsx data into MS SQL database. People prefer to do it this way, there is hard code for file path of output.xlsx in import program.
Ideally, both XYZ_application.xlsm and output.xlsx are closed before being used.
But some people forget to close the files are using XYZ_application.xlsm and/or output.xlsx
There will be issue if multiple people working on output.xlsx at the same time. There should be only one person using the program at a time(everyone tries to import his own data into MS SQL database), since it is not often used program, it is okay that only one person uses the program at a time. The bigger reason is: there is hard code for file path of output.xlsx in import program (written by former employee). We cannot have multiple people working on output.xlsx at the same time, moreover, there is VBA code in XYZ_application.xlsm to open output.xlsx, so output.xlsx cannot be already opened.
Question: Is there a way to put some code in XYZ_application.xlsm Workbook_Open to detect if current file XYZ_application.xlsm is already opened by others and if output.xlsx is already opened. If it is possible, is there a way to know who keeps the file open?
Bookmarks