Below is the code I am using, to get around the problem. I just set the
macros VISIBLE property to False, the rest are set to xlVeryHidden.
For Each s In Sheets
If s.Name <> "Banner" Then
If s.Name = "Macros" Then
s.Visible = False
Else
s.Visible = xlVeryHidden
End If
End If
Next
I do have some code that allows these sheets to be visible, if the
username is mine, so that is not a problem.
Why can't I do this, even though the help says it can be set?
I'd appreciate any help I could get.
Thanks
A macro cannot VeryHide the module in which it resides. This is a feature
of Excel, apparently designed for extra protection. If a macro calls a
subroutine in another module, it will also be unable to hide that module.
The only way to very hide all the modules in a workbook is to write a
temporary module with the code:
Sub HideModules()
For each m in Modules
If m.Name <> Activesheet.Name Then m.Visible = xlVeryHidden
Next
End Sub
Make sure this module is the active sheet, then run the macro and delete
it. Remember to protect your workbook, otherwise users can write their own
macro to unhide all of yours.
You could include this module in another workbook, to save you from having
to write it repeatedly. In this case, the macro could look like
sub HideModules()
For each m in Workbooks("workbookname").Modules
M.visible=xlVeryHidden
Next
end sub
Hope this helps.
Greg
Larry Jones <llj...@flash.net> wrote in article
<33DBA1...@flash.net>...
Sub hide_modules()
Dim vmdl
For Each vmdl In Modules
vmdl.Visible = False
Next vmdl
End Sub
Larry Jones <llj...@flash.net> wrote in article
<33DBA1...@flash.net>...
> I am trying to hide my macros from the users, so they cannot be opened
> and changed. When I try to set the VISIBLE attribute to xlVeryHidden, I
> get an Excel error telling me I cannot se the module property.
>
>
Thanks
Jules
Short of a macro, how about entering the following formula in B1 and then
filling down (dblclk on the fill handle)?
=IF(MOD(ROW(),2),(A2-A1),"")
Not sure what you mean by "the columns can also vary".
Regards,
--
Russ Wiggin, CPA
Newton, MA
Julian <jul...@saix.net> wrote in article <33DC72...@saix.net>...