ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disable the "X" close button in an excel application (https://www.excelbanter.com/excel-programming/327653-re-disable-x-close-button-excel-application.html)

keepITcool

Disable the "X" close button in an excel application
 


OFF TOPIC?

Hi Jan Karel,

I've never knew you could have bloat in thisworkbook..

I honestly thought codebloat could only exist in userforms, where the
compiled parts (the frx) contains dirt from unused objects.
(I've also had some troublesome experiences with FlexGrids, which have
some nasty habits)

I can imagine the flexgrid problems popping up in sheets, but then that
would bloat the sheet object being the container of the troublesome
activeX... and i doubt the problems would be solved by exporting/
importing the code as that wouldnt affect the sheet's objects.
(I'll test that)

Codebloat in normal or class modules theoretically doesnt make sense.
(note that some filereduction from CodeCleaner is achieved simply by
saving it in decompiled state)

You wouldn't have an example of bloated code (in a plain or workbook
module) somewhere on your harddisk, would you?

I'd love to have a look.


--
Jurgen
| www.XLsupport.com | keepITcool chello nl | amsterdam


Jan Karel Pieterse wrote :

Hi Bob,

It is better, IMO as well as yours, as it saves on that unnecessary
class module,


I must say I disagree on that point.

Class modules can easily be cleaned by an export/remove/import cycle
(or by using Rob Bovey's code cleaner), but the Thisworkbook module
cannot be removed.

So when a bloat creeps into the Thisworkbook module, one will have to
start with a fresh workbook to remove it.

This my main reason why I try to keep the Thisworkbook module as slim
as I possibly can.

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com


Jan Karel Pieterse

Disable the "X" close button in an excel application
 
Hi KeepITcool,

Codebloat in normal or class modules theoretically doesnt make sense.
(note that some filereduction from CodeCleaner is achieved simply by
saving it in decompiled state)


It happens though. I have seen a couple of workbooks of mine go
haywire, which mostly could be fixed by a code cleaning job.
Mostly it requires Modules that contain quite some code (50K or more)
and have been heavily edited in the past without ever cleaning up.

One was even corrupted so bad I had to copy the code to Notepad and
paste that back after inserting a new module.

The symptom it showed was that I would get a compile error (object
doesn't support this property or method!) on this kind of line:

sTemp=Thisworkbook.worksheets("Sheet1").Range("A1" ).Value

Note the lack of capitalisation of the worksheets collection!

You wouldn't have an example of bloated code (in a plain or workbook
module) somewhere on your harddisk, would you?


Sorry, this was a customer workbook I cannot share.

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com



All times are GMT +1. The time now is 03:22 AM.

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