PDA

View Full Version : Solved: Intercept Late Binding (Double Click xl file)



MountainVogu
06-07-2006, 04:42 PM
Hi,

Tek-Tips won't let me create an account at the moment some error or other. Otherwise I would post this API (I think) query there.

OK here goes.

I have a small VB executable that creates a session of excel and open workbook in that session, using the vb app to open excel and the workbook stops the enable/disable macro dialog from appearing.

The workbook runs from userforms, thus it looks like an app (xl icon in taskbar also changed) and I can minimise/maximise to and from taskbar etc.

My problem and its only cosmetic, when a user double clicks an excel file on the desktop/explorer etc as xls's are associated with excel if my workbook and thus excel are minimised, they will by restored as the double clicked file is binding to the open session. I stop it from causing issues using a class module to close the newly opened book.

I could disassociate xls's with excel but that would be really unhelpful to users.

So after that explanation: is there away to intercept the call from the double clicked file to the open session and get windows to open a new session of excel.

Cheers

Ivan F Moala
06-08-2006, 01:06 AM
Try



Application.UserControl = False
Application.IgnoreRemoteRequests = True


Reset back when form closes

Ivan F Moala
06-08-2006, 01:10 AM
sorry ...... Place that code above for your Userforms intialize event or reference it in yor VB application to the appropriate Xl object.

MountainVogu
06-08-2006, 02:25 PM
Ivan,

Firstly. top site (yours) fantastic links have used your resource many times.

Secondly and I quote "..the more you learn the more you realise how much you don't know! "

Something as simple as a built-in, I didn't even know it existed and of course it worked perfectly.

Nice One.