Confused

B

Brian Tozer

I have the following macro in my Personal.xls workbook.

Sub ShowFormulae()
ActiveWindow.DisplayFormulas = Not ActiveWindow.DisplayFormulas
' test line
End Sub

I was able to add the comment ' test line to the macro without unhiding the
workbook.
I did not think this was possible.
Windows | Unhide shows that it is hidden.

Where am I confused?
Brian Tozer
 
A

A.W.J. Ales

Brian,

Hiding a workbook has only effect on the "normal" (i.e. non VB view)

In the VBE you can always see you workbooks.
This also applies to hidden sheets in a workbook.

(NB In the VBE it is possible that you can't open a file if it is password
protected)

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *
 
D

Dave Peterson

You can protect the project in the VBE by
Tools|VBAProject Properties|Protection Tab
(give it a nice memorable password)

And if you want to make it so your personal.xl* is not "unhideable", you can
save it as an addin.

In excel,
File|SaveAs
In the save as type, near the bottom is "Microsoft Excel Add-in (*.xla)

But that means that your macros won't be viewable from Tools|macro|macros...

You'll have to provide some way to run them. I like adding some stuff to the
menubar. If you like this idea, take a look at John Walkenbach's menumaker
program.

http://j-walk.com/ss/excel/tips/tip53.htm

And one of the nice things about making it an addin is that you can refer to
your userdefined functions just like they were built in.

Instead of:
=personal.xls!myfunction(A1)
you could use
=myfunction(a1)
 

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