EXCEL Crash after passwort on VBA-code

talljohn
05-17-2008, 03:01 AM
Hello Experts,

as long as I don't protect my VB-Code I have no problem to close and open my EXCEL Workbook. (VBA code of ~ 10,000 lines, 1 multipage with ~200 elements).

If I protect the code and try to open the workbook, EXCEL first comes up with the worksheet I call in a Sub Auto_open() but then abords with that ugly window which is asking to report this error to MS or not and option to recover the file. (which doesn't work, it's running into the same error)

In the past this error occured mostly (not always) if I closed the workbook. But now it comes up if I open it already - what makes my application useless of course. (I note that it takes much more time to open the workbook without code protection, because there' intensive calculation of cells indicated, while this calculation seems not to be proceded by opening a protected workbook. This may be important.)

Desperately,

Johannes

Colin Legg
05-19-2008, 11:54 AM
Hi Johannes,

More questions for you rather than answers, I'm afraid....


What code are you running in the Auto_open procedure?
What version of Excel are you running - do other people use this workbook and do they experience the same issues?
Do you have any "additional" controls (eg. Listview, Treeview) embedded in your multipage control?


The more information you can give us the better....

Colin

talljohn
05-26-2008, 06:17 AM
Thanks Colin,

it looks that an "Unload UserForm" before saving the file helps. But strange that this happens only if the code is protected.

Johannes

Colin Legg
05-26-2008, 09:15 AM
Thanks Colin,

it looks that an "Unload UserForm" before saving the file helps. But strange that this happens only if the code is protected.

Johannes

Hi Johannes,

We might be able to give you an explanation for this behaviour, but for us to have any chance then we will need the information I asked for in #2.

Glad you found a workaround.

Colin

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum