ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Application.Quit en Excel crash (https://www.excelbanter.com/excel-programming/327050-application-quit-en-excel-crash.html)

Jos Vens[_2_]

Application.Quit en Excel crash
 
Hi,

My program starts with a Login-form, where the user has to give a password
to go inside the application. On that login-form, you have an OK-button,
and a Cancel button.

Pressing the cancel button closes the form and then quits excel with
application.quit.

Not always but often, excel crashes here, and I don't know why. In the
past, I got some reasons for a crash:

-not unloading the form and application.quit = crash
-not Office XP-SP3 = crash

So now, it works fine (I installed SP3 on Office XP). However, on another
machine with Office2000, it didn't crash until I installed SP3 of
Office2000.

What am I doing wrong, why is Excel crashing on Application.quit?

Thanks
Jos Vens



Jos Vens[_2_]

Additional Information: Application.Quit en Excel crash
 
Additional information:

I think the problem has something to do with a non-modal Login-form. When I
trace, I encounter the application.quit command, but Excel does not quit! It
runs still some code, which is not valid anymore (hidden workbooks are
closed)

Jos


"Jos Vens" schreef in bericht
...
Hi,

My program starts with a Login-form, where the user has to give a password
to go inside the application. On that login-form, you have an OK-button,
and a Cancel button.

Pressing the cancel button closes the form and then quits excel with
application.quit.

Not always but often, excel crashes here, and I don't know why. In the
past, I got some reasons for a crash:

-not unloading the form and application.quit = crash
-not Office XP-SP3 = crash

So now, it works fine (I installed SP3 on Office XP). However, on another
machine with Office2000, it didn't crash until I installed SP3 of
Office2000.

What am I doing wrong, why is Excel crashing on Application.quit?

Thanks
Jos Vens




Jos Vens[_2_]

Solution Found, but strange: Application.Quit en Excel crash
 
Hi,

I found the solution: when I set Application.EnableEvents=false, before
Application.Quit, there is no further code running and there is no crash,
not on Office XP nor on Office 2000. I still wonder why Excel continues
running code after Application.Quit??? As far as I remember, it worked fine
when my userform was modal.

Jos

"Jos Vens" schreef in bericht
...
Hi,

My program starts with a Login-form, where the user has to give a password
to go inside the application. On that login-form, you have an OK-button,
and a Cancel button.

Pressing the cancel button closes the form and then quits excel with
application.quit.

Not always but often, excel crashes here, and I don't know why. In the
past, I got some reasons for a crash:

-not unloading the form and application.quit = crash
-not Office XP-SP3 = crash

So now, it works fine (I installed SP3 on Office XP). However, on another
machine with Office2000, it didn't crash until I installed SP3 of
Office2000.

What am I doing wrong, why is Excel crashing on Application.quit?

Thanks
Jos Vens




Jim Thomlinson[_3_]

Solution Found, but strange: Application.Quit en Excel crash
 
Thanks for posting your solution... I have had the smae problem in a 2000
application. I neer worried about it becuase we are migrating to 2003 but if
the problem persists...

"Jos Vens" wrote:

Hi,

I found the solution: when I set Application.EnableEvents=false, before
Application.Quit, there is no further code running and there is no crash,
not on Office XP nor on Office 2000. I still wonder why Excel continues
running code after Application.Quit??? As far as I remember, it worked fine
when my userform was modal.

Jos

"Jos Vens" schreef in bericht
...
Hi,

My program starts with a Login-form, where the user has to give a password
to go inside the application. On that login-form, you have an OK-button,
and a Cancel button.

Pressing the cancel button closes the form and then quits excel with
application.quit.

Not always but often, excel crashes here, and I don't know why. In the
past, I got some reasons for a crash:

-not unloading the form and application.quit = crash
-not Office XP-SP3 = crash

So now, it works fine (I installed SP3 on Office XP). However, on another
machine with Office2000, it didn't crash until I installed SP3 of
Office2000.

What am I doing wrong, why is Excel crashing on Application.quit?

Thanks
Jos Vens





Tushar Mehta

Solution Found, but strange: Application.Quit en Excel crash
 
Thanks for sharing the solution. It is *possible* that your code did
not crash with the userform showed modally because XL stops executing
the VBA code and stops the user from interacting with it while the
userform is visible. With a modeless form, all other activity proceeds
while the dialog box is visible. So, other macros including event
procedures will be executed *asynchronously* with the thread displaying
the userform.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
Hi,

I found the solution: when I set Application.EnableEvents=false, before
Application.Quit, there is no further code running and there is no crash,
not on Office XP nor on Office 2000. I still wonder why Excel continues
running code after Application.Quit??? As far as I remember, it worked fine
when my userform was modal.

Jos

"Jos Vens" schreef in bericht
...
Hi,

My program starts with a Login-form, where the user has to give a password
to go inside the application. On that login-form, you have an OK-button,
and a Cancel button.

Pressing the cancel button closes the form and then quits excel with
application.quit.

Not always but often, excel crashes here, and I don't know why. In the
past, I got some reasons for a crash:

-not unloading the form and application.quit = crash
-not Office XP-SP3 = crash

So now, it works fine (I installed SP3 on Office XP). However, on another
machine with Office2000, it didn't crash until I installed SP3 of
Office2000.

What am I doing wrong, why is Excel crashing on Application.quit?

Thanks
Jos Vens






All times are GMT +1. The time now is 08:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com