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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top