Coupla questions

R

Rich

Hi there,

Q1. When I force run the following code:

Sub workbook_before_close()
Call Show_Welcome
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Visible = (ws.Name <> "Welcome") * -1 - 1
Next ws
Application.SaveWorkspace
End Sub

I get a dialogue saying "A file named "Resume.XLW" already exists in
the location. Do you want to replace it?"
What does this mean, and how would I auto-replace file without user
intervention?

Q2. What is to stop someone, once macros are enabled to go to
Tools|Macro|Macros| then deleting or running whatever they want?

Q3. Is there a global routine that will prevent anybody from saving
through any method, whether it be a dialogue prompt, the save button
in the toolbar, or through File|Save/Save As?

Thanks for your time.
 
F

Frank Kabel

Hi
try:
Sub workbook_before_close()
Call Show_Welcome
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Visible = (ws.Name <> "Welcome") * -1 - 1
Next ws
application.displayalerts=false
Application.SaveWorkspace
application.displayalerts=true
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top