Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default vbModeless user form crashes Excel

The user form loads on workbook_open as vbmodeless. The workbook
minimizes and basically stays in the background. You cannot access the
workbook unless you close the form. But once you close the form, you
can open a second workbook. Then when the form is open you can access
both workbooks. The problem occurs when you exit Excel without closing
the form, which causes a crashed type message. I tried adding form.hide
before close, but that didn't work. Any ideas?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default vbModeless user form crashes Excel

use the workbook's before close event..

example

Private Sub Workbook_BeforeClose(Cancel As Boolean)
test
''' Cancel = True '' use this for testing to stop the workbook closing!!
End Sub

Sub test()
If UserForm1.Visible Then
Unload UserForm1
MsgBox "Closing form"
Else
MsgBox "OK"
End If
End Sub

Patrick Molloy
Microsoft Excel MVP



"Plutopotamus" wrote:

The user form loads on workbook_open as vbmodeless. The workbook
minimizes and basically stays in the background. You cannot access the
workbook unless you close the form. But once you close the form, you
can open a second workbook. Then when the form is open you can access
both workbooks. The problem occurs when you exit Excel without closing
the form, which causes a crashed type message. I tried adding form.hide
before close, but that didn't work. Any ideas?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default vbModeless user form crashes Excel


Thank you, Patrick. That worked! I had tried beforeclose but obviously
wasn't coding it right. Thanks much!


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel crashes depending on user?? Khuli Excel Discussion (Misc queries) 0 June 17th 09 11:04 AM
Excel User Form MG Excel Worksheet Functions 0 February 25th 09 12:58 AM
ExcelAddIn - Excel Crashes under User Account - tool to troubleshoot elime Excel Discussion (Misc queries) 0 July 3rd 07 08:06 AM
Excel 2003 crashes when opening a file from one particular user [email protected] Excel Discussion (Misc queries) 0 May 17th 06 05:23 PM


All times are GMT +1. The time now is 06:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"