ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   XL2002 - Application Resize Event... (https://www.excelbanter.com/excel-programming/406678-xl2002-application-resize-event.html)

Trevor Williams

XL2002 - Application Resize Event...
 
Hi All

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

Thanks

Trevor Williams

Peter T

XL2002 - Application Resize Event...
 
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

"Trevor Williams" wrote in
message ...
Hi All

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

Thanks

Trevor Williams




Trevor Williams

XL2002 - Application Resize Event...
 
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


"Peter T" wrote:

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

"Trevor Williams" wrote in
message ...
Hi All

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

Thanks

Trevor Williams





Peter T

XL2002 - Application Resize Event...
 
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/mic...ba7392312b9483

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

"Trevor Williams" wrote in
message ...
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


"Peter T" wrote:

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

"Trevor Williams" wrote in
message ...
Hi All

Is there an event that triggers when the application is resized? (not

the
window).
If so, what is it?

Thanks

Trevor Williams







Trevor Williams

XL2002 - Application Resize Event...
 
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

"Peter T" wrote:

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/mic...ba7392312b9483

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

"Trevor Williams" wrote in
message ...
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


"Peter T" wrote:

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

"Trevor Williams" wrote in
message ...
Hi All

Is there an event that triggers when the application is resized? (not

the
window).
If so, what is it?

Thanks

Trevor Williams








All times are GMT +1. The time now is 04:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com