XL2002 - Application Resize Event...

  • Thread starter Thread starter Trevor Williams
  • Start date Start date
T

Trevor Williams

Hi All

Is there an event that triggers when the application is resized? (not the
window).
If so, what is it?

Thanks

Trevor Williams
 
Hi Trevor,

Unfortunately resizing Excel's main window does not trigger an Excel/vba
type event (though of course resizing a workbook window within the
application does).

In theory it might be possible to trap Windows (ie OS) events but it would
imply terms such as "subclass" and "callback" functions to trap WM_SIZE of
the Excel's main window (application.hwnd in xl2002+ or requires FindWindow
API in earlier versions). Tricky stuff, in particular to ensure no
possibility of GPF.

Also not sure, but it I suspect it would also require running a continuous
loop (perhaps with DoEvents to allow for other activities) to catch the
event.

Regards,
Peter T
 
Hi Peter.

It's a shame there's nothing built in. I don't think my skills levels go as
deep as dabbling with Windows events etc.

Thanks for the reply.

Trevor
 
Hi again. I agree, not unreasonable at all to want something built in.

I had a further attempt to get something working but failed, so I asked in
the main vb group. Karl Peterson responded saying in effect forget about
trying to do it in VBA. That's good enough for me.

http://groups.google.co.uk/group/mi...k=gst&q=detect+window+resize#f7ba7392312b9483

If really really interested to take it further, which I assume is not the
case, I found a C dll that does appear to work albeit with the restriction
of requiring a continual loop in VBA. See my followup in the same thread for
details.

Regards,
Peter T
 
Hi Peter

I've given it a quick read through and decided the coding outweighs the need!
It's more a 'nice to have' rather than an essential part of the workbook.

Thanks for your time and effort looking into it.

Regards

Trevor
 

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