Problems with the OnWorkbookClose() Event

  • Thread starter Thread starter joel.summerfield
  • Start date Start date
J

joel.summerfield

Hi all

Im trying to prevent the OnWorkbookClose() event from running by
setting the cancel flag to true, however after this the program just
hangs for until i stop the debugger.

Current Code is...

STDMETHODIMP CAppEventListener::HandleBeforeWorkbookClose(IDispatch*
xlBook, VARIANT_BOOL* fCancel)
{
*fCancel = VARIANT_TRUE;
HRESULT hr = S_OK;
return hr;
}

I cant see exactly where the problem is but im sure its in this
function somewhere. This function is called when the
BeforeWorkbookClose() Event is fired.

Any help you guys might be able to offer would be greatly apreicated

Joel
 
Back
Top