View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Stuart[_21_] Stuart[_21_] is offline
external usenet poster
 
Posts: 154
Default Where to place Code question

Many thanks for all the suggestions and comments. I'm trying to help someone
who has even less knowledge of excel than me (......yeah, there must be
someone?) with a simple 'template' for them to try out. They'll report back,
I'll adapt it, and when they're happy I'll pass it to them as a template.
They will then use the template to produce their finished workbook, and when
happy, save it, such that all code is removed. They can then distribute the
book to equally 'newbie' colleagues, without any fear of macro warnings
when the book opens, worrying them.
There is no need for any code from that point onwards ....
the purpose of the template is just to speed up the production of his
finished document.

Later, when he is more comfortable, I'll give him an addin, such that the
'stripping of code' issue will not exist.

Many thanks again.

Regards.

"Rob Bovey" wrote in message
...
Hi Stuart,

I wish to avoid a module if possible.


Why?

Once the user has completed their workbook, I would like them to be able
to:
delete buttons in all sheets
delete the form
delete the Master sheet and save the workbook
without any residual code.


Create an additional button called "Export Worksheet" that copies the
worksheet into a new workbook, deletes all the buttons and saves it to the
name and location of the user's choice. If you have all related code in
modules, none of it will follow the worksheet when it's copied out of the
workbook..

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm

"Stuart" wrote in message
...
I have a workbook with a Master sheet. The Master sheet is visible, but
protected. On the Master are buttons
(from the Control Toolbox) that add new sheets and then
format them according to 'pages' stored on the Master. So far all code is
behind the Master.

There is also one form.

When new sheets are added, there are new buttons (from the Forms toolbar)
on those new sheets; again the code to do is behind the Master. As I
understand it, the buttons should be assigned to subs in a general
module.

I wish to avoid a module if possible.

Once the user has completed their workbook, I would like them to be able
to:
delete buttons in all sheets
delete the form
delete the Master sheet and save the workbook
without any residual code.

Can this be done, or must I set a reference to the VBA
Extensibilty library (for every user) and use (eg) an external button to
remove the code?

Regards.