LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Workbook Reopens After Close

I am having a strange problem with a workbook that has some userforms.

The workbook opens by itself about 5 seconds after I close it. This only
happens when I choose not to save it. It stays closed when I save and it
stays closed when I exit whether I save or not.

I can't figure it out.
Any help would be appreciated!
owp^3

PS: I am using 2003 and here are the relevant subs in the ThisWorkbook object.

Private Sub Workbook_Activate()

ActiveWorkbook.Unprotect "Wh4tIf?"
ActiveSheet.Unprotect "Wh4tIf?"
ActiveWindow.WindowState = xlMaximized
Application.ScreenUpdating = False

With Application
.ShowStartupDialog = False
.DisplayFormulaBar = False
End With

With ActiveWindow
.DisplayHeadings = False
.DisplayOutline = False
.DisplayZeros = False
End With

ActiveWorkbook.Protect Password:="Wh4tIf?", Structu=True, Windows:=True

For Each ws In Sheets
ws.Unprotect "Wh4tIf?"
Next ws

ActiveSheet.Protect Password:="Wh4tIf?", UserInterfaceOnly:=True,
DrawingObjects:=False, Contents:=True, Scenarios:=True
ActiveSheet.EnableSelection = xlUnlockedCells

Application.ScreenUpdating = True

frm_Splash.Show

End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
TitleText = "Thank YOU! Please return this survey to MKT_Project_Desk"
ThankYouMsg = "Thank you for participating in this Impacts &
Approaches survey." & vbCrLf & _
"Please eMail this workbook to: Mktg_Project_Desk" & vbCrLf
& _
"The Marketing PMO Team" & vbCrLf & vbCrLf '& _

Result = MsgBox(ThankYouMsg, vbOKOnly, TitleText)

End Sub

Private Sub Workbook_Deactivate()
ProtectionToggle
Application.ScreenUpdating = False
With ActiveWindow
.DisplayHeadings = True
.DisplayOutline = True
.DisplayZeros = True
End With
With Application
.ShowStartupDialog = True
.DisplayFormulaBar = True
End With
Application.ScreenUpdating = True
ProtectionToggle
End Sub

 
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
Sort not saved across saves/reopens Shane Devenshire Excel Worksheet Functions 1 March 17th 09 08:03 PM
Open New Workbook / Save and Close Current Workbook Joe K. Excel Programming 1 December 7th 07 08:04 PM
code reopens file AJB Excel Programming 1 September 13th 07 10:14 PM
Closing a workbook from a macro doesn't close the workbook Dave P Excel Programming 2 July 10th 07 06:16 PM
Workbook reopens after close John Michl Excel Programming 2 December 13th 06 10:49 PM


All times are GMT +1. The time now is 02:23 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"