I got this a long time ago from someone else... I don't remember where so I can't give the credit where it is due....
Anyway the following proceedure will force the user to enable macros.
You have to have one sheet named WARNING and on that sheet have a text box or something that tells the user that they must enable macros. I would also suggest a brief explaination on how to set macro security just in case any of your users have their security level set too high and macros are automatically being disabled.
Then, place the following five Sub Proceedures into the Worksheet module of your workbook.
The last proceedure makes it so the Save As option is not allowed so be sure you have the worksheet named and in the place where you want it to go before adding it.
Now your user can not save the file either.
That proceedure came from Dave Hawley who by the way has some great books on excel!
I would suggest that you password protect your VBA code so the user can not disable this process after opening the workbook.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
HideSheets
End Sub
Private Sub Workbook_Open()
UnhideSheets
End Sub
Private Sub HideSheets()
Dim sht As Object
Application.ScreenUpdating = False
ThisWorkbook.Sheets("Warning").Visible = xlSheetVisible
For Each sht In ThisWorkbook.Sheets
If sht.Name <> "Warning" Then sht.Visible = xlSheetVeryHidden
Next sht
Application.ScreenUpdating = True
ThisWorkbook.Save
End Sub
Private Sub UnhideSheets()
Dim sht As Object
Application.ScreenUpdating = False
For Each sht In ThisWorkbook.Sheets
sht.Visible = xlSheetVisible
Next sht
ThisWorkbook.Sheets("Warning").Visible = xlSheetVeryHidden
Application.ScreenUpdating = True
End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim IReply As Long
If SaveAsUI = True Then
IReply = MsgBox("Sorry, this file can not be saved as another name. Press OK to save or, Cancel to Exit.", _
vbQuestion + vbOKCancel)
Cancel = (IReply = vbCancel)
If Cancel = False Then Me.Save
Cancel = True
End If
End Sub