View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Protecting a workbook

Hi
try adding the line
Application.displayalerts = false
before your save command
and the line
Application.displayalerts = True
after this command

--
Regards
Frank Kabel
Frankfurt, Germany

"rayzgurl " schrieb im
Newsbeitrag ...
I've had people diddling in the workbook by pressing "disable macros"
instead of "enable macros". I've been able to get around this by
setting the workbook as hidden and then unhiding it only when the
macros are enabled. It is also set to hide again when the project is
closed. In addition, I have the workbook book set to save

automatically
on close, without prompting the user. My problem is, now that I have
put in the visible=False command in the before close, it no longer
saves without prompting the user. I do not want the user prompted to
save on close. The save on close without prompting worked fine until

I
added the visible = false command.
I just want the workbook to save and close automatically. Here is the
code I have in the workbook module.
-------

Private Sub Workbook_Open()

Windows("B2B tracking.xls").Visible = True


' minimize all windows Except Xl
Dim objShell As Object

Set objShell = CreateObject("Shell.Application")
objShell.MinimizeAll
Application.Wait (Now + TimeValue("0:00:01"))
Application.WindowState = xlMinimized
Set objShell = Nothing


Application.WindowState = xlMinimized



' Open user form

Splash.Show
ChooseForm.Show
' Update Form

Workbooks("b2b tracking.xls").Save
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Windows("B2B Tracking.xls").Visible = False
ThisWorkbook.Save


End Sub


---
Message posted from http://www.ExcelForum.com/