Tekito 0 Junior Poster in Training

This involves an Excel file that is being controlled by another program. I have written my own excel file with vba that works with this Excel file. So basically, the program opens up an excel file, then the user opens up my excel file in the same instance of the excel application to modify it.

I want it so before the user closes the Excel file (however which way), I run a check and give the user the option to cancel. This is usually done easily by cancelling within the workbook_Beforeclose event. However, this program is controlling the excel file somehow so that even when I cancel inside the workbook_BeforeClose event, the program overrides my cancel and closes the entire excel application anyways. I have tried cancelling in both the workbook's beforeclose event, and the excel application's WorkbookBeforeclose event; neither works.

Any other preceding events or tricks to counter whatever it is this program is doing??? I am drawing a complete blank.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.