Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Closing Excel w/o Error message

I have an Excel workbook that uses forms for data entry. An EXIT command is
built into the entry forms which closes the workbook fine. My problem is
that the entry forms can be closed (hidden) to allow te users to navigate
through the different sheets to review data and/or print. If a user clicks
on the Window actions in the Upper Right (X) or through File / Exit and not
through the entry form the application returns the "Micsoft Excel has
encountered a problem" error message.

What is the best way to eliminate this error in Code and where in the code?
In the Entry Form code or This Workbook?

Thanks...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Closing Excel w/o Error message

I am not sure exactly what you are trying to do, but I think you should be
able to deal with this by handling the "Workbook_BeforeClose" event in the
ThisWorkbook code module.

"The Hawk" wrote:

I have an Excel workbook that uses forms for data entry. An EXIT command is
built into the entry forms which closes the workbook fine. My problem is
that the entry forms can be closed (hidden) to allow te users to navigate
through the different sheets to review data and/or print. If a user clicks
on the Window actions in the Upper Right (X) or through File / Exit and not
through the entry form the application returns the "Micsoft Excel has
encountered a problem" error message.

What is the best way to eliminate this error in Code and where in the code?
In the Entry Form code or This Workbook?

Thanks...

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Closing Excel w/o Error message

Lucas, thanks for the tip. Put me on the right path. Used the following code:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
' Close Entry form before closing workbook
Cancel = True
MsgBox "You must Select Exit from the Entry Panel"
frmEntry.Show

End Sub



"Lucas Swanson" wrote:

I am not sure exactly what you are trying to do, but I think you should be
able to deal with this by handling the "Workbook_BeforeClose" event in the
ThisWorkbook code module.

"The Hawk" wrote:

I have an Excel workbook that uses forms for data entry. An EXIT command is
built into the entry forms which closes the workbook fine. My problem is
that the entry forms can be closed (hidden) to allow te users to navigate
through the different sheets to review data and/or print. If a user clicks
on the Window actions in the Upper Right (X) or through File / Exit and not
through the entry form the application returns the "Micsoft Excel has
encountered a problem" error message.

What is the best way to eliminate this error in Code and where in the code?
In the Entry Form code or This Workbook?

Thanks...

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Closing Excel w/o Error message

Glad that I could help.

"The Hawk" wrote:

Lucas, thanks for the tip. Put me on the right path. Used the following code:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
' Close Entry form before closing workbook
Cancel = True
MsgBox "You must Select Exit from the Entry Panel"
frmEntry.Show

End Sub



"Lucas Swanson" wrote:

I am not sure exactly what you are trying to do, but I think you should be
able to deal with this by handling the "Workbook_BeforeClose" event in the
ThisWorkbook code module.

"The Hawk" wrote:

I have an Excel workbook that uses forms for data entry. An EXIT command is
built into the entry forms which closes the workbook fine. My problem is
that the entry forms can be closed (hidden) to allow te users to navigate
through the different sheets to review data and/or print. If a user clicks
on the Window actions in the Upper Right (X) or through File / Exit and not
through the entry form the application returns the "Micsoft Excel has
encountered a problem" error message.

What is the best way to eliminate this error in Code and where in the code?
In the Entry Form code or This Workbook?

Thanks...

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
Error message when opeing and closing excel Tony Excel Worksheet Functions 1 November 29th 08 07:28 AM
Error message adaytum.xla when closing workbook in Excel 2003 Laura2008 Excel Discussion (Misc queries) 1 November 5th 08 06:36 PM
how do i get a message to pop up when closing excel 2007 bobhogg Excel Discussion (Misc queries) 1 July 1st 08 04:06 PM
Unexpected error message on closing an Excel file KG Excel Discussion (Misc queries) 1 March 21st 05 02:39 PM
Closing Excel error message from Access 2K Dave[_23_] Excel Programming 1 August 8th 03 10:54 AM


All times are GMT +1. The time now is 09:38 AM.

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

About Us

"It's about Microsoft Excel"