I am running the code from an MS Access db. When the MS Excel file opens and it happens to a non activated MS Office version, the Microsoft Office Activation Wizard dialog box appears. The code in MS Access hangs until the Close button is pressed on the dialog box. Hence the requirement for a API solution.
Once the dialog box closes and the MS Excel file is closed, I can then produce a message box to say that the user does not have an official MS Office copy as normally the MS Excel file will be in invisible mode and as a genuine copy of MS Office does not produce the dialog box, then there is no problem. The above exercise places the MS Excel file in visible mode to check the existence of a genuine MS Office copy.
Hope that makes sense.