Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Protecting a workbook

I've had people diddling in the workbook by pressing "disable macros
instead of "enable macros". I've been able to get around this b
setting the workbook as hidden and then unhiding it only when th
macros are enabled. It is also set to hide again when the project i
closed. In addition, I have the workbook book set to save automaticall
on close, without prompting the user. My problem is, now that I hav
put in the visible=False command in the before close, it no longe
saves without prompting the user. I do not want the user prompted t
save on close. The save on close without prompting worked fine until
added the visible = false command.
I just want the workbook to save and close automatically. Here is th
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 Su

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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/


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Protecting a workbook

Thanks Frank,

Sorry to say it is still prompting me to save the spreadsheet on close
It has to have something to do with the fact that I am hiding it befor
closing it. I'm just not sure what.... :

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Protecting a workbook

Anyone have any idea how to get a hidden spreadsheet to stop promptin
for Save on close???

See code above...


THANK!!!!!

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Protecting a workbook

Have you tried putting in something like:

myworkbook.Saved = True

after you save it?

hth,

Doug

"rayzgurl " wrote in message
...
Anyone have any idea how to get a hidden spreadsheet to stop prompting
for Save on close???

See code above...


THANK!!!!!!


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





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Protecting a workbook

YOU ROCK!!!!

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

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
Protecting a workbook Kim Excel Worksheet Functions 5 September 29th 08 06:26 PM
Protecting a workbook Sasikiran Excel Discussion (Misc queries) 1 March 6th 08 10:05 PM
Protecting a workbook Oldjay Excel Discussion (Misc queries) 1 February 24th 08 08:40 PM
Protecting Workbook!.. Neo1 Excel Worksheet Functions 3 May 3rd 06 01:22 PM
Protecting Workbook Paul Cooling Excel Discussion (Misc queries) 2 March 7th 05 11:55 AM


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

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"