Afternoon All,
When opening a file you are asked to enable or disable macros - if you disable, you still get access to the file - is there a simple way to ensure the user always enables the macros?
Cheers,
Graham
Afternoon All,
When opening a file you are asked to enable or disable macros - if you disable, you still get access to the file - is there a simple way to ensure the user always enables the macros?
Cheers,
Graham
Hi there
Try this: and I hope you are looking for this.
Under Tools Menu >Macros>Security
select security Level "LOW" (Beware of Virus) and Under Trusted Source, Select Trust access to Visual Basic Project.
Regards
Maqbool
Thanks Maqbool,
Does your solution mean the excel program settings need to change, or is it part of the file?
KR,
Graham
Whilst the answer already given will work it has obvious dangers. Also, you cannot generally control other users choices. Instead have a look at Dave's EnableMacros.zip here
Thanks Roy,
I have downloaded them but my Winzip program cannot open it. I down loaded another and it would not open either.
Is there something else I should be doing?
KR GB
Roy,
No need to respond, typically I picked probably the only way to download them without actually downloading them, if you know what I mean.
I tried again using DAP and no problem - question answered.
Thanks heaps,
Graham
ps Who you going for in the World Cup - starts 10days!
Hi Graham
I am not a Football fan, but I have to hope that England do well!!! :congrats: :banana:
Gidday Guys,
The code from web site is excellent, however, for my small brain I need an explaination of some bits and pieces.
the code
Public bIsClosing As Boolean
Dim wsSheet As Worksheet
Sub HideAll()
Application.ScreenUpdating = False
For Each wsSheet In ThisWorkbook.Worksheets
If wsSheet.CodeName = "Sheet1" Then
wsSheet.Visible = xlSheetVisible
Else
wsSheet.Visible = xlSheetVeryHidden
End If
Next wsSheet
Application.ScreenUpdating = True
End Sub
Sub ShowAll()
bIsClosing = False
For Each wsSheet In ThisWorkbook.Worksheets
If wsSheet.CodeName <> "Sheet1" Then
wsSheet.Visible = xlSheetVisible
End If
Next wsSheet
Sheet1.Visible = xlSheetVeryHidden
End Sub
What is "bIsClosing" - I cannot find any reference to it in any of the references I have. And is it necessary???
Cheers,
GB
Yes, it is necessary, Its just a variable that Dave declared. "BisClosing" (book is closing true/false). He could just as easily called it "Hey_Man_I_am_Closing".
Thanks Doug,
I think I understand - the code (from module) from my last post needs to combine with that Dave put into "Thisworkbook" - by doing this; no matter how the file is opened or closed, it requires the user to enable macros or nothing other than the "Sheet1!" is visible. - Correct?
Graham
Hi Doug
You are correct, the main sheets are hidden at all times, but with macros enable the open all sheets macro runs and the "splash" sheet is hidden when the workbook opens
Many thanks fellas,
Modified the code to suit my file, leant more about worksheet indexs and naming - works beautifully now.
I just love it when things work as you expect them to.....
GB
Don’t have an account yet? Register yourself now and be a part of our community!