C
Chrissy
Can any one help with this please?
Chrissy.
Chrissy wrote
Chrissy.
Chrissy wrote
Chrissy said:Can any one help with this please?
Chrissy.
Chrissy wrote
The computer
This suggests your installation may well have a bundle of
different dll's floating around
Win98 is rather unstable for professional use IMHO
On which machine?
Yours , theirs or both ?
You WILL be since you are using different OS but this shouldnt
matter.
It sounds to me like a corrupt workbook, I'd suggest dumping
out all the code modules and importing them into clean workbook
Alternately try VBA Code Cleaner which essentially
does the same thing
http://www.bmsltd.co.uk/MVP/Default.htm
It is SO hard to find a problem that is not there after the editor is
opened.
Assuming it's macros that cause excel to crash..
In the xl2k environment:
open the sheet with shift pressed to disable AutoRun macro's
Open the code module by entering the VBA password, as VB cannot
break/debug when the VBA password hasn't been entered.
(Or remove until the problem is solved.)
Check the References for any references which may be missing.
Then compile the code.
You dont give a clue as to what the code that crashes
the PC is doing...
If it compiles ok, the first step is taken.
But no guarantees yet.
Now start running the code and try to analyse WHICH
procedure is crashing excel.
Then post back... with that code snippet
Do you open workbooks or are you just working with
a single book.
Do you work with applications other then excel?
No.
Do you use API's? (Declare function/sub)?
Hi Chrissy,
You may want to add some Stop statements throughout your code and remove
them one by one until it crashes - that way, you may be able to determine
where the crash is taking place. Sometimes, when code crashes as the user
runs it but not from the VBE, it is caused by timing issues. Some
well-placed DoEvents statements where the crash is taking place (or an
Application.Wait) may fix the problem for you.
Chrissy said:I have developed an Excel spreadsheet which I want to run
on 15 different computers.
I developed it in Excel 2002 and Excel 2000 - depending one
which machine I was at. It is to run on Excel 2000. I cannot
make it fail in any way on my computer but it does on all other
computers I have tried it on now.
My setup is:
Win2k Professional
Office XP Professional installed then
Excel from Office 2k professional installed separately then,
because Office XP stopped working
Office XP Professional reinstalled
Their setup
Win98
Office2k Professional
I have a couple of forms and 10 worksheets. I have protected the
project from viewing and the worksheets are all password protected.
There is a button on the first spreadsheet which opens up the main
form. This causes a page fault in Excel and Excel then closes. The
computer needs rebooting at this stage so the workbook can be
reopened as it will get a sharing problem if just opened without a
reboot. The computer is not networked.
If I remove the protection from the project it works on one machine
but not on one other. If I run it on my machine even after a reboot
and without entering any passwords it runs fine. I run it under
Excel2k and not Excel XP.
Am I correct in thinking that I must be using different DLLs to the
other machines? What can I do to get this working?
Any help or suggestions are more than welcome.
TIA.
Chrissy.
Chrissy said:keepitcool wrote
Have done that ages ago - was the first thing I did but it did not
work.
Yeah - I realize that I missed that out - after doing the step you
mention above,
it crashes if I have not opened the VBA editor. If I just open it
and closing it or leave it open then it does not crash. Makes it
hard to find the problem.
That is hard to do as I have to change the code to write a trace of
where
it is going and save this to a file with each procedure and I have to
do this
on a machine which is in a store. This is because, as I said above
and forgot
to add to the original post that it does not happen if the VBA editor
has been
opened. I have extra code in there already (which is commented out)
that
can trace procedures - I just need to add the bit to save this to a
file and not display it on screen.
I think I need to get one of those machines to play, oops - do
further testing - on because it is not going wrong on my machine.
It either gets a page fault or access violation - I think I got it
wrong on the original post as it was late - I was tired and very
frustrated.
I believe that it has something to do with trying to change something
in a worksheet which is protected but this is only a hunch at this
time.
I open one workbook.
Only one or two pieces of code activates a workbook to do something on
it. Obviously opening it activates it. After this workbook is
opened I activate
the other workbook - the one with the code in it - and go to a
specific sheet
which is linked to another workbook - I change the links to be to the
newly opened workbook. If I do not activate the worksheet which
contains the links then
Excel cannot change the link as the worksheets are protected and the
UserInterfaceOnly option does not seem to apply to changing links on
a non active worksheet with links in any of its formulas.
... and that point is why I believe that it has something to do with
the protection
I have on the worksheets.
All other code operates no matter what workbook and worksheet is
active and I
refer to specific workbooks and worksheet or named ranges. Most of
the worksheets
are hidden.
Not totally sure what you mean - but I did have some code which was
an API
call and I have deleted this.
I have reinstalled Excel and uninstalled it to try to get only the
Excel 2000 DLLs there - last night when I went to bed I was not able
to get the error on my machine
but have just got this one - I did a final reboot before going to bed
but thought that I had not done a reinstall immediately before that.
The error was...
The instruction at "0x00000000" referenced memory at 0x00000000".
The memory
could not be "read".
If I restart Excel and try again but open the VBA editor it does not
get this error hence my inability to even identify the code at fault.
Chrissy.
I am suspicious that this might be a problem with early vs. late binding
of object variables, or possibly unqualified references. There is a KB
(AIRC) on a Excel2k problem with early vs. late binding - early binding
causing errors in some instances. Essentially, early binding is use of
a specific object type like Dim myBook as Workbook rather than late
binding as Dim myBook as Object. Unqualified references are like using
Sheets(1) instead of fully qualified references like
Application.Workbooks("myBook").Worksheets(1). At the Beginning of Time
for VBA, I wrote code that would run just fine in the editor and fail in
Excel from unqualified references. It turned out that *I* was confused
and then writing confused code.
The idea of using Stop to help debug is good. I use msgbox("a,b") where
a is a procedure name or number and b is a line number. This lets me
track a persistent problem during execution quickly.
One thing to do is make sure your Win98 is clean. Removing temp files,
temp internet files is important, and defragmenting is important also.
IMO, Win98 is subject to memory leaks from all kinds of sources so
rebooting on persistent errors is important.
Also, make sure that virtual memory is under Windows control.
Win98 is quite resource-bound,
so resources must be kept under control
to make VBA work well since the use of objects,forms, etc, will consume
what little resource stack Win98 has, and error dialogs are often no
help in diagnosing low resources. The Office Startup application
(osa.exe) is notorious for eating resources and should be removed from
startup in Win98 - it serves no useful purpose anyway.
No wallpaper,
screensaver,
active desktop,
no more than 30 files (not folders) in the root of C (C:\),
no desktop icons,
no temp files,
minimum startup applications,
no more than 40-50 fonts,
no visual effects in menus,
will help keep VBA and Office under control by freeing resource stack. You
can run the resource monitor
to see what is happening with resources
when your code runs; any color other than green can make VBA squirrely.
For VBA, always release local objects when exiting a procedure, and
public objects when no longer needed. You know there is big resource
trouble brewing if forms only partially appear.
Sorry for the long response, but I have a special dark place in my heart
for VBA in Win98.
PS. Keep in mind (someone correct me if wrong) that Excel2k, XP
workbooks are not downward compatible with Excel97 unless specifically
saved to Excel97 workbook format (universal format Excel2002, 2000, 97 &
95 format) . Excel97 workbooks are upward compatible. Excel97 is
somewhat better for developing "universal" VBA as a consequence.
Chrissy, your clock needs to be set to the correct time/time zone.
Would you please add the part of the code that it make the system to crash,?
can run the resource monitor to see what is happening with resources
when your code runs;
any color other than green can make VBA squirrely.
What?
For VBA, always release local objects when exiting a procedure,