Application.quit error
"Sabosis" skrev i melding
...
Hello
My code looks at a cell in my active workbook and if the value is zero,
then quit. It works fine if I step through it using F8, but when the code
runs through Workbook_Open, it will error out. When i hit debug, it just
shuts down Excel. Any ideas?
Not knowing your code, code that runs fine in steps but not in sequence
usually needs DoEvents inserted here and there. The word means something
like "listen to the operating system, and also wait here until the last
instruction is completed"
This said, Application.Quit is very brutal. Excel allows us to have multiple
tasks and documents open simoultaneouslly. Very few, or in real life no,
documents have the right to do shut everything down.
HTH. Best wishes Harald
|