S
spilly39
Hi
Can any MVP explain the intermittent errors I & others get when Excel won't
complete the Workbook_Open event, with the message
"Can't exit design mode because Control <control type (or Name?)> can not
be created"
My app has some ActiveX controls placed on a few worksheets as a friendly
way of invoking macros and/or Forms. e.g. my Buttons sheet (hence my UG
name) has several option buttons and a nice big Go button.
I get the error (only sometimes - maddeningly) when WBOpen activates the
Buttons sheet at the end.
It scared the pants off me that I had a corrupt workbook, but it seems that
all is actually well if you switch worksheets to "Buttons" manually and
carry on as normal. But that's no way to write an app.
I've seen complaints about this since Excel 97 & 2K, mainly from less
experienced users, but no authoritative explanation of what's going on.
I'm GUESSING from hints in what I've read, that it may be something to do
with compiling;
that plain vanilla code can execute before ALL the references in every part
of the code have been fully resolved - or something vaguely like that.
Does anyone know what happens behind the scenes when you load a workbook ?
e.g. Are there two paths for the VB engine code depending on whether or the
engine discovers the code needs compiling because the developer hadn't done
so before save on close?
Could it be that my probs will go away by always compiling before save?
Could I rely on that?
Will it stand up to users practices (who won't change the VB code, only the
data)?
It just feels flakey at present, so I'm worried.
Oh yes! One other thing. I use CodeCleaner (indeed I even wrote my own with
a bit of help from Chip Pearson a few years ago), so it isn't an accumulated
cr*p issue.
I planned to post this to the Userform group (where ActiveX controls are
normal), but that UG seems moribund - only one post this year
And I want to start another more specific Userform thread soon too. This
seems the best place unless you say otherwise.
spilly
Can any MVP explain the intermittent errors I & others get when Excel won't
complete the Workbook_Open event, with the message
"Can't exit design mode because Control <control type (or Name?)> can not
be created"
My app has some ActiveX controls placed on a few worksheets as a friendly
way of invoking macros and/or Forms. e.g. my Buttons sheet (hence my UG
name) has several option buttons and a nice big Go button.
I get the error (only sometimes - maddeningly) when WBOpen activates the
Buttons sheet at the end.
It scared the pants off me that I had a corrupt workbook, but it seems that
all is actually well if you switch worksheets to "Buttons" manually and
carry on as normal. But that's no way to write an app.
I've seen complaints about this since Excel 97 & 2K, mainly from less
experienced users, but no authoritative explanation of what's going on.
I'm GUESSING from hints in what I've read, that it may be something to do
with compiling;
that plain vanilla code can execute before ALL the references in every part
of the code have been fully resolved - or something vaguely like that.
Does anyone know what happens behind the scenes when you load a workbook ?
e.g. Are there two paths for the VB engine code depending on whether or the
engine discovers the code needs compiling because the developer hadn't done
so before save on close?
Could it be that my probs will go away by always compiling before save?
Could I rely on that?
Will it stand up to users practices (who won't change the VB code, only the
data)?
It just feels flakey at present, so I'm worried.
Oh yes! One other thing. I use CodeCleaner (indeed I even wrote my own with
a bit of help from Chip Pearson a few years ago), so it isn't an accumulated
cr*p issue.
I planned to post this to the Userform group (where ActiveX controls are
normal), but that UG seems moribund - only one post this year
And I want to start another more specific Userform thread soon too. This
seems the best place unless you say otherwise.
spilly