Re: VBA Extensibility library and dynamic code compilation
- From: "Peter T" <peter_t@discussions>
- Date: Wed, 7 Mar 2007 17:14:11 -0000
I always get rid of COM references (object pointers) by freeing/clearingand
then "set mypointer = nothing" but thanks for the idea.
Pretty sure I've done all that but suspect something circular is going on
with my thing.
Your live data feeds etc is way outside what I know about so this may seem
naive -
If, as you say, you think your problems are related to picking up external
events, wouldn't disabling your events help until everything is ready to go
again.
Regards,
Peter T
"John.Greenan" <JohnGreenan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:48D9945E-D9D5-432C-927E-1ACFA38DBE7D@xxxxxxxxxxxxxxxx
"slightly different effect" means that if I manually hit ALT+F11 and thenand
compile I seem to be able to changes values a few more times before Excel
crashes. [my intial statement that manually doing this was crash-free was
incorrect].
I always get rid of COM references (object pointers) by freeing/clearing
then "set mypointer = nothing" but thanks for the idea.volume
I think that the problem I am now seeing is being caused by the high
of real time data updates that are hitting the workbook. So, while Ithink
the compilation problem is fixed we can still crash out Excel, it justtakes
a bit longer.feeds
And just for fun and games, Microsoft do not have the ability (as things
stand) to replicate this bug, since they do not have any real time data
such as Reuters going into their development systems - at least accordingto
David Gainer last time I spoke with him.OP).
I think this problem is caused by the external events that we pick up.
Lots of real time data + worksheet_calculate = unstable ?????
--
www.alignment-systems.com
"Peter T" wrote:
Sounds like things are moving in the right direction.
What "slightly different effect".
Did you try the other 3 of the 4 pointers (if not already before the
causing my
Any object pointers in your main app that might be related, not released
before moving on. A wild guess, only mention it as I have a something
obscure along those lines at this very moment I can't track down,
butExcel to crash on close.
Regards,
Peter T
"John.Greenan" <JohnGreenan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A72BA2B7-7316-4C97-BF20-5CAD42E43BA7@xxxxxxxxxxxxxxxx
Peter T - thanks for the pointer - that reduces the number of crashes
effectit
does not fix it. Strangely it seems to have a slightly different
canto
manually running the compile VBA project button.
--
www.alignment-systems.com
"Peter T" wrote:
Hi John,
I have also found adding code programmatically behind object modules
tobe
fraught with problems, most especially if coding form thisworkbook
(programmatically)CodeNamethisworkbook, but that I take it is not what you are doing.
Some of your problems might depend on what you are doing (changing
?) and whether or not the VBE is open when you make the changes.
Have you tried wb save/close/open, and/or flashing
andthe
VBE open/closed. Or maybe adding code to a sheet in a temporary wb
messagemove
the sheet to yours.
To compile, ensuring the wb is active in the vbe
Set oCtrl = xlApp.VBE.CommandBars.FindControl(ID:=578)
oCtrl.Execute
I think its 578 in all versions though perhaps not in XL-2007
msgbox oCtrl.caption
Regards,
Peter T
"John.Greenan" <JohnGreenan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
creates annews:0B0C569C-88BB-4FB2-9B6F-8462A56B7CF6@xxxxxxxxxxxxxxxx
I have inherited a VB6 application that runs unattended and
whencreatedExcel
2002 spreadsheet dynamically using the Excel library.
The VB6 code then uses the VBA Extensibility library to access the
codeworksheet and then adds a "worksheet_calculate" event using
mycodemodule.CreateEventProc("Calculate", "Worksheet")
This "worksheet_calculate" event code is then populated by the VB6
writing some VBA using
mycodemodule.InsertLines lngTargetLine, strHeaderLine1
This works ok and we see that the VBA code works properly, but
thethe
worksheet is opened by a user we find that we cannot change any of
celldata
in the worksheet with calculation set to automatic - editing any
VBAwill
repeatably cause Excel to crash out.calculation
To change the worksheet values we either
(a) switch calculation to manual, change the sheet and then put
back to automatic
OR
(b) we enter VBA and compile the worksheet using "Tools">"Compile
then weProject".
If we change the worksheet without making one of these changes
VBAfind
that Excel just crashes out. This appears to be an Excel bug.
So, if we could find a "proper" way to get the VBA in the
worksheet_calculate to be compiled we would not face this problem.
As you will know, the VBE library has no inbuilt method to compile
create a(MakeCompiledFile and BuildFileName are only for VB6 code to
implement..dll
rather than compile VBA) and I am not happy about trying to
doesa
nasty
send keys method.
Has anyone encountered this and worked out a way to do this that
not
use sendkeys???
Cheers,
John
--
www.alignment-systems.com
.
- Follow-Ups:
- References:
- Re: VBA Extensibility library and dynamic code compilation
- From: Peter T
- Re: VBA Extensibility library and dynamic code compilation
- From: John.Greenan
- Re: VBA Extensibility library and dynamic code compilation
- From: Peter T
- Re: VBA Extensibility library and dynamic code compilation
- From: John.Greenan
- Re: VBA Extensibility library and dynamic code compilation
- Prev by Date: Re: InputBox Question
- Next by Date: Re: Recordset from excel worksheet
- Previous by thread: Re: VBA Extensibility library and dynamic code compilation
- Next by thread: Re: VBA Extensibility library and dynamic code compilation
- Index(es):
Relevant Pages
|