Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Hiding Part of the VBA Code

Hello Everyone

I've developed some query tools for querying databases. I
want to send them out to users but keep my code hidden.
From reading prior posts I've picked up

Lock you project in the VBE under the tools menu
= "Project Name"
Properties (Thanks Tom).

But what if I need to allow users to develop their own
code without seeing mine. I'm thinking something like the
veryhidden option for sheets, but for modules.

Thanks in Advance

Matt

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Hiding Part of the VBA Code

if you protect your code (and save it as an addin), your users will be
able to write there own procs (using your public functions or
procedures... ) when they add a reference to your app.


So the only thing for you to do is decide which of the functions /
procs should be exposed to the users.

Those procs should be public while the rest should be Private.

You can make all procs in a module Private by putting following line in
the top of your module's decalaration section.

Option Private Module

My advice: first make everything private,
then add 1 module which is public and include some (wrapper) functions
there that external apps can access.

Check the Object browser to see which functions the addin exposes when
it's locked.



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Matt" wrote:

Hello Everyone

I've developed some query tools for querying databases. I
want to send them out to users but keep my code hidden.
From reading prior posts I've picked up

Lock you project in the VBE under the tools menu
= "Project Name"
Properties (Thanks Tom).

But what if I need to allow users to develop their own
code without seeing mine. I'm thinking something like the
veryhidden option for sheets, but for modules.

Thanks in Advance

Matt



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Hiding Part of the VBA Code

Thanks keepITcool

I'm afraid a lot of this is beyond me
Not sure how to
Save it as an addin

or

then add 1 module which is public and include some
(wrapper) functions

or

Check the Object browser to see which functions the addin
exposes when it's locked.

Is there anywhere I could go for detailed help with these?

Thanks

Matt


-----Original Message-----
if you protect your code (and save it as an addin), your

users will be
able to write there own procs (using your public

functions or
procedures... ) when they add a reference to your app.


So the only thing for you to do is decide which of the

functions /
procs should be exposed to the users.

Those procs should be public while the rest should be

Private.

You can make all procs in a module Private by putting

following line in
the top of your module's decalaration section.

Option Private Module

My advice: first make everything private,
then add 1 module which is public and include some

(wrapper) functions
there that external apps can access.

Check the Object browser to see which functions the

addin exposes when
it's locked.



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Matt" wrote:

Hello Everyone

I've developed some query tools for querying

databases. I
want to send them out to users but keep my code

hidden.
From reading prior posts I've picked up

Lock you project in the VBE under the tools menu
= "Project Name"
Properties (Thanks Tom).

But what if I need to allow users to develop their own
code without seeing mine. I'm thinking something like

the
veryhidden option for sheets, but for modules.

Thanks in Advance

Matt



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Hiding Part of the VBA Code



Save as addin:
in Excel file/saveas
in the type dropdown... at the bottom you'll find:
Microsoft Excel Addin (*.xla)



any half decent book on VBA will spend at least a chapter on variables
and scope... but you've got to read the tedious stuff as well.

read up on :

Public Sub / Function
Private Sub / Function
Option Private Module


Object Browser:
in VBE press [f2]
you can explore all properties and functions of your projects and the
libraries selected in Tools/References.



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Matt" wrote:

Thanks keepITcool

I'm afraid a lot of this is beyond me
Not sure how to
Save it as an addin

or

then add 1 module which is public and include some
(wrapper) functions

or

Check the Object browser to see which functions the addin
exposes when it's locked.

Is there anywhere I could go for detailed help with these?

Thanks

Matt


-----Original Message-----
if you protect your code (and save it as an addin), your

users will be
able to write there own procs (using your public

functions or
procedures... ) when they add a reference to your app.


So the only thing for you to do is decide which of the

functions /
procs should be exposed to the users.

Those procs should be public while the rest should be

Private.

You can make all procs in a module Private by putting

following line in
the top of your module's decalaration section.

Option Private Module

My advice: first make everything private,
then add 1 module which is public and include some

(wrapper) functions
there that external apps can access.

Check the Object browser to see which functions the

addin exposes when
it's locked.



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Matt" wrote:

Hello Everyone

I've developed some query tools for querying

databases. I
want to send them out to users but keep my code

hidden.
From reading prior posts I've picked up

Lock you project in the VBE under the tools menu
= "Project Name"
Properties (Thanks Tom).

But what if I need to allow users to develop their own
code without seeing mine. I'm thinking something like

the
veryhidden option for sheets, but for modules.

Thanks in Advance

Matt



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Hiding Part of the VBA Code

Thanks keepITcool

Didn't realise an .xla was so simple
And F2 included my own procedures

Will get on to that wrapping stuff in a book

Thanks again

Matt


-----Original Message-----


Save as addin:
in Excel file/saveas
in the type dropdown... at the bottom you'll find:
Microsoft Excel Addin (*.xla)



any half decent book on VBA will spend at least a

chapter on variables
and scope... but you've got to read the tedious stuff as

well.

read up on :

Public Sub / Function
Private Sub / Function
Option Private Module


Object Browser:
in VBE press [f2]
you can explore all properties and functions of your

projects and the
libraries selected in Tools/References.



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Matt" wrote:

Thanks keepITcool

I'm afraid a lot of this is beyond me
Not sure how to
Save it as an addin

or

then add 1 module which is public and include some
(wrapper) functions

or

Check the Object browser to see which functions the

addin
exposes when it's locked.

Is there anywhere I could go for detailed help with

these?

Thanks

Matt


-----Original Message-----
if you protect your code (and save it as an addin),

your
users will be
able to write there own procs (using your public

functions or
procedures... ) when they add a reference to your app.


So the only thing for you to do is decide which of the

functions /
procs should be exposed to the users.

Those procs should be public while the rest should be

Private.

You can make all procs in a module Private by putting

following line in
the top of your module's decalaration section.

Option Private Module

My advice: first make everything private,
then add 1 module which is public and include some

(wrapper) functions
there that external apps can access.

Check the Object browser to see which functions the

addin exposes when
it's locked.



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Matt" wrote:

Hello Everyone

I've developed some query tools for querying

databases. I
want to send them out to users but keep my code

hidden.
From reading prior posts I've picked up

Lock you project in the VBE under the tools menu
= "Project Name"
Properties (Thanks Tom).

But what if I need to allow users to develop their

own
code without seeing mine. I'm thinking something

like
the
veryhidden option for sheets, but for modules.

Thanks in Advance

Matt



.



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Hiding Part of the VBA Code

with 'a wrapper function' I mean following

in a Private Module you have say
Function DoTheEasyStuff(x)
DoTheEasyStuff= x & " was done"
end Function

Now in a Public Module you have:
Public Function MyCustomFunction(YourStringArgument As String)
MyCustomFunction=DoTheEasyStuff(YourStringArgument )
end sub

The latter 'wraps' or packages the internal procedure into something
more elaborate (or simple) which the 'external' user can see.

that's it. sorry for the lingo.


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Matt" wrote:

Thanks keepITcool

Didn't realise an .xla was so simple
And F2 included my own procedures

Will get on to that wrapping stuff in a book

Thanks again

Matt


-----Original Message-----


Save as addin:
in Excel file/saveas
in the type dropdown... at the bottom you'll find:
Microsoft Excel Addin (*.xla)



any half decent book on VBA will spend at least a

chapter on variables
and scope... but you've got to read the tedious stuff as

well.

read up on :

Public Sub / Function
Private Sub / Function
Option Private Module


Object Browser:
in VBE press [f2]
you can explore all properties and functions of your

projects and the
libraries selected in Tools/References.



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Matt" wrote:

Thanks keepITcool

I'm afraid a lot of this is beyond me
Not sure how to
Save it as an addin

or

then add 1 module which is public and include some
(wrapper) functions

or

Check the Object browser to see which functions the

addin
exposes when it's locked.

Is there anywhere I could go for detailed help with

these?

Thanks

Matt


-----Original Message-----
if you protect your code (and save it as an addin),

your
users will be
able to write there own procs (using your public
functions or
procedures... ) when they add a reference to your app.


So the only thing for you to do is decide which of the
functions /
procs should be exposed to the users.

Those procs should be public while the rest should be
Private.

You can make all procs in a module Private by putting
following line in
the top of your module's decalaration section.

Option Private Module

My advice: first make everything private,
then add 1 module which is public and include some
(wrapper) functions
there that external apps can access.

Check the Object browser to see which functions the
addin exposes when
it's locked.



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Matt" wrote:

Hello Everyone

I've developed some query tools for querying
databases. I
want to send them out to users but keep my code
hidden.
From reading prior posts I've picked up

Lock you project in the VBE under the tools menu
= "Project Name"
Properties (Thanks Tom).

But what if I need to allow users to develop their

own
code without seeing mine. I'm thinking something

like
the
veryhidden option for sheets, but for modules.

Thanks in Advance

Matt



.



.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding part of VBA or a Module in Macro Iraj Excel Discussion (Misc queries) 3 March 23rd 12 11:47 AM
Hiding VB Code johnsail Excel Discussion (Misc queries) 6 March 9th 09 07:53 PM
Hiding Code Jae Excel Discussion (Misc queries) 3 August 10th 05 08:10 PM
Hiding VBA code David Wooddall-Gainey Excel Programming 4 August 22nd 03 06:45 PM
hiding vba code Richard Choate Excel Programming 0 July 17th 03 08:33 PM


All times are GMT +1. The time now is 02:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"