Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Please try this function in Excel 8 (97) (Crash?)

2 views
Skip to first unread message

David Copp

unread,
May 8, 1998, 3:00:00 AM5/8/98
to

Hello,

If you are running Excel 8 (97), would you mind to please drop this code
into a module and then return to a worksheet and type the function
name,=dave(), and let me know Excel crashes or not? (SAVE YOUR WORK 1ST) I
wrote this in Excel 5 and it works perfectly but always crashes Excel 8.
(Arg) I even removed and then installed Excel again because this code should
work perfectly. Any suggestions?


Function dave()
Dim AD As AddIn
For Each AD In Application.AddIns
MsgBox AD.Title
Next AD
End Function


Thanks

Sincerely,

Dave
da...@chilipepper.bc.ca

P.S. I'm not trying to write code that will display all the names of the
listed add-ins. I have written the above as a sample. I suspect that the
"For Each Next" statement is the cause of the crashes. I have diagnosed it
down to this statement in my code since I have eliminated everything else
and left it in a module and then Blam-O... Excel 8 bites it big time!

Nick Hodge

unread,
May 9, 1998, 3:00:00 AM5/9/98
to

David

Works OK with me both in debug and as a worksheet function

On entry in a worksheet it cycle a MsgBox showing each of my loaded add-in's
in turn and finishes by displaying zero in the cell

--
HTH
Nick Hodge
Oxford, England
nick_...@lineone.net
David Copp wrote in message ...

Thomas Ogilvy

unread,
May 9, 1998, 3:00:00 AM5/9/98
to

David,
Do you have any equal signs, question marks, exclamation points or other
non-alpha numeric characters in your addin module name or names of any
procedures/functions in your addin. I would also try removing any non-excel
97 Microsfoft supplied add-in from the list of available addins (which you
may have achieved by reinstalling Excel - did you uninstall it first - then
install it?). Just some things to try.

Tom Ogilvy

Bob Flanagan

unread,
May 9, 1998, 3:00:00 AM5/9/98
to

Dave, it also crashes my copy of Excel. However, if you change it to a
sub, it works fine. You may need to use auto_open to run it as a sub and
record the information, and then have the function check the recorded list.
Please note it causes about a minute delay in running the first time as
Excel must run another workbook. Which is probably what is causing the
crash.

Bob Flanagan
Macro Systems - Productivity Add-ins & VB code
http://www.add-ins.com


David Copp <da...@chilipepper.bc.ca> wrote in article
<OEKPJYx...@uppssnewspub05.moswest.msn.net>...

David Copp

unread,
May 9, 1998, 3:00:00 AM5/9/98
to

Tom,

My code is clean as far as I can tell. I will try removing all add-ins
and then running it as you suggested. I did uninstall Excel first and then
reinstalled it. My next step is to remove all of Office and then reinstall
it. If that doesn't work, I'm gonna format the hard drive and reinstall
Windows and everything else.


Thomas Ogilvy wrote in message ...

David Copp

unread,
May 9, 1998, 3:00:00 AM5/9/98
to

Bob,

Any idea what's going on here? I've had a few emails that say the code works
fine as a function, yet it crashes on for you and me. Hmm?

Thanks Bob

Dave
da...@chilipepper.bc.ca

Bob Flanagan wrote in message <01bd7b42$869c7360$5f5bb7cc@flanagrw>...

Chip Pearson

unread,
May 9, 1998, 3:00:00 AM5/9/98
to

Dave,

You've stumbled on to a VERY strange problem. The FIRST time I ran your
function, it crashed Excel. So I restarted Excel, entered the function
again and everything worked fine.

I tried it as a SUB rather than as a FUNCTION, tried using accessing the
Addins collection by index number rather than a FOR EACH loop, and
everything else I could think of, and it worked just fine.

So I quit Excel, restarted it, opened a new worksheet, reentered the
function, and it crashed Excel. Restarted Excel, ran your function, and it
works!! Quit, restart, run function, and CRASH. Now, it seems to be
working.

There seems to be now pattern.

Does it always crash for you? I would make a write down the complete
message you get when it crashes, and contact Microsoft.

If you find an answer, please post it here.

Cordially,
Chip Pearson
http://home.gvi.net/~cpearson/excel.htm

David Copp wrote in message ...

David Copp

unread,
May 9, 1998, 3:00:00 AM5/9/98
to

Chip,

Thanks for your reply. To answer your question, it ALWAYS crashes my
Excel 8 (works perfectomundo under 5) . If I declare it as a SUB then no
problem as others have replied. My problem is that I need the For Each Next
Addin code in all of my add-ins as a function ... I'll have to try and find
a work around.

Re: contacting Msoft. Can you tell me how to got about this? As an
aside, I believe I have found another bug in Excel 8, involving repeated
recalculation with a custom function in a 1 way data table (again the exact
same file works perfectly under 5 and 7). I have reported this twice to
Msoft at http://support.microsoft.com/support/feedback (they title this
page "Report a bug in a Msoft product") but I have not had any reply. (Last
report was 2 months ago) So, this does not look like the way to inform the
company.

Last time I heard, Msoft would not give tech support (as a means to
finding out if there is a problem in Excel or not) for custom functions, VBA
etc. I would be happy to pay for a single incident tech. support if it
clears up the problem. Any suggestions?


>Does it always crash for you? I would make a write down the complete
>message you get when it crashes, and contact Microsoft.

Thanks for your help. Please feel free to contact me directly.
Sincerely,
David Copp
da...@chilipepper.bc.ca
Burnaby BC Canada (eh)

David Copp

unread,
May 9, 1998, 3:00:00 AM5/9/98
to

Laurent,

I moved the xll file you suggested and bingo, the function worked
perfectly. I
also noticed that the delay was gone for getting a result after hitting
enter (it may just be me).

I will get in touch with Msoft about this and post a response to the
programming forum. Unfortunately, I have to head out of town Monday (11th)
for a
while (maybe 2-3 weeks - talk about poor timing). I will try to report to
Msoft
before I leave.


I appreciate your help and will be in touch asap.


Thanks
Sincerely,
Dave
da...@chilipepper.bc.ca


P.S. MSoft's server is currently having problems as I tried to submit the
full description of the problem mentioned but it would not accept it. I will
try again later tonight. (9th)

As mentioned, I will be away from my computer for a bit (I would kill
for a notebook), but I fully intend to fully follow this up. I ask for your
patience. If you do not hear from me, please feel free to drop me an email
and I will be happy to reply.

This will be my last post for a while. Thanks to everyone who helped and
dropped me a line on this problem. Sincerely-Dave


Chip Pearson

unread,
May 9, 1998, 3:00:00 AM5/9/98
to

Laurent,

I never cease to amazed by your answers! I am truly, genuinely, impressed.

>In the For...Next loop, the AddIn.Title method executes automatically a
>function called xlAddInManagerInfo stored in each XLL. This function
>returns the long name of the XLL add-in.

How did you know this? What have you read that I haven't? I want to read
that book. I suspect it is because you write XLL files in C/C++, a skill
that I do not yet have.

And why would this cause the occasional, apparently random, behavior that I
experienced? Is it just part of the "bug"? I could not consistently
reproduce David's problem. Sometimes his code would crash, sometimes it
would run just fine. I couldn't establish any pattern.

Laurent Longre wrote in message <3554F7...@wanadoo.fr>...
>David,
>
>I think that I've detected which add-in causes this crash: it should be
>Analys32.xll (the analysis toolpack, located in Macrolib\Analysis).
>
>Try to move it temporary to another directory (not a subdirectory of
>Excel) and test your function. It should work now without crash.
>
>In the For...Next loop, the AddIn.Title method executes automatically a
>function called xlAddInManagerInfo stored in each XLL. This function
>returns the long name of the XLL add-in. For some reason, the
>xlAddInManagerInfo function of Analys32.xll crashes Excel if AddIn.Title
>has been called by a worksheet UDF. It is a bug, because my own XLL
>don't cause any GPF in the same context.
>
>Laurent

Laurent Longre

unread,
May 10, 1998, 3:00:00 AM5/10/98
to David Copp

David Copp

unread,
May 10, 1998, 3:00:00 AM5/10/98
to

Greetings everyone.

I submitted the bug to MSoft but I am headed out of town. I look forward
to sharing the results with you when I return in a week or 2.

Thanks for your help,

Sincerely,

Dave

Laurent Longre

unread,
May 10, 1998, 3:00:00 AM5/10/98
to Chip Pearson

Hello Chip!

Chip Pearson wrote:
> How did you know this? What have you read that I haven't? I want to read
> that book. I suspect it is because you write XLL files in C/C++, a skill
> that I do not yet have.

In the Microsoft Excel 97 Developers Kit. I've compiled one of my XLLs
in debug mode and tested David's function. I expected that the
AddIn.Title property would fire the xlAddInManagerInfo function of this
XLL, and it did so.



> And why would this cause the occasional, apparently random, behavior that I
> experienced? Is it just part of the "bug"? I could not consistently
> reproduce David's problem. Sometimes his code would crash, sometimes it
> would run just fine. I couldn't establish any pattern.

I don't know exactly. I suppose that this XLL tries to write in a memory
location which doesn't belong to its own memory aera (access violation).

The access violations don't systematically cause an immediate crash.

Sometimes they cause an abnormal termination and sometimes they are
harmless. When a DLL or EXE tries to poke some data in an address X
outside of its own allocated memory, X could belong to the kernel or to
another program (-> immediate or later crash), or it could be located in
an aera which is still not allocated (-> no visible consequence). It
depends on how the system has shared the available memory between the
applications in the present moment.

Thus, the consequences of an access violation are *not* random for the
system, though they could seem to be random for the user. That's why you
could not establish a pattern.

Hope this helps

... and congratulations for your excellent work in these newsgroups,
Chip!

Laurent

0 new messages