Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Functions - visibility

Hi,

Functions within a project (.xls, .xlmx, .xla,.xlax) are verry
usefull, but i have a question abouth the 'visibility' of the
functions.

I know that if a function is declared as Private, it's 'invisible'
outside the project, but once you declare it as Public, it's also
visible outside your project and can be seen in the Excel Functions
dropdown box.

My 'problem' is following.
I'm writing a add-in with multiple UserForms and multiple Modules. I
have several function in this project, and some of them are 'called'
from different modules / userforms. Obvious, i need to declare them as
Public, so that i can use this (those) functions(s) from the different
modules / userforms. This means also that this (those) functions are
visible outside the project. This can be dangerous if someone use this
function outside the project. Is there a way to call a function from
different userforms / modules within the same project, but make them
invisible to the 'outside world'?

Regards,
Ludo
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Functions - visibility

Ludo laid this down on his screen :
Hi,

Functions within a project (.xls, .xlmx, .xla,.xlax) are verry
usefull, but i have a question abouth the 'visibility' of the
functions.

I know that if a function is declared as Private, it's 'invisible'
outside the project, but once you declare it as Public, it's also
visible outside your project and can be seen in the Excel Functions
dropdown box.

My 'problem' is following.
I'm writing a add-in with multiple UserForms and multiple Modules. I
have several function in this project, and some of them are 'called'
from different modules / userforms. Obvious, i need to declare them as
Public, so that i can use this (those) functions(s) from the different
modules / userforms. This means also that this (those) functions are
visible outside the project. This can be dangerous if someone use this
function outside the project. Is there a way to call a function from
different userforms / modules within the same project, but make them
invisible to the 'outside world'?

Regards,
Ludo


You could put the following statement[s] at the top of each module in
your project...

Option Explicit '//you should already have this
Option Private Module '//make code available to 'this' project only

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Functions - visibility

On Thursday, April 19, 2012 10:24:37 PM UTC+2, GS wrote:
Ludo laid this down on his screen :
Hi,

Functions within a project (.xls, .xlmx, .xla,.xlax) are verry
usefull, but i have a question abouth the 'visibility' of the
functions.

I know that if a function is declared as Private, it's 'invisible'
outside the project, but once you declare it as Public, it's also
visible outside your project and can be seen in the Excel Functions
dropdown box.

My 'problem' is following.
I'm writing a add-in with multiple UserForms and multiple Modules. I
have several function in this project, and some of them are 'called'
from different modules / userforms. Obvious, i need to declare them as
Public, so that i can use this (those) functions(s) from the different
modules / userforms. This means also that this (those) functions are
visible outside the project. This can be dangerous if someone use this
function outside the project. Is there a way to call a function from
different userforms / modules within the same project, but make them
invisible to the 'outside world'?

Regards,
Ludo


You could put the following statement[s] at the top of each module in
your project...

Option Explicit '//you should already have this
Option Private Module '//make code available to 'this' project only

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


Thanks a lot Garry for the response.
The 'Option Explicit' is always on, wasn't aware of the 'Option Private Module'.

Regards,
Ludo
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Functions - visibility

Ludo pretended :
On Thursday, April 19, 2012 10:24:37 PM UTC+2, GS wrote:
Ludo laid this down on his screen :
Hi,

Functions within a project (.xls, .xlmx, .xla,.xlax) are verry
usefull, but i have a question abouth the 'visibility' of the
functions.

I know that if a function is declared as Private, it's 'invisible'
outside the project, but once you declare it as Public, it's also
visible outside your project and can be seen in the Excel Functions
dropdown box.

My 'problem' is following.
I'm writing a add-in with multiple UserForms and multiple Modules. I
have several function in this project, and some of them are 'called'
from different modules / userforms. Obvious, i need to declare them as
Public, so that i can use this (those) functions(s) from the different
modules / userforms. This means also that this (those) functions are
visible outside the project. This can be dangerous if someone use this
function outside the project. Is there a way to call a function from
different userforms / modules within the same project, but make them
invisible to the 'outside world'?

Regards,
Ludo


You could put the following statement[s] at the top of each module in
your project...

Option Explicit '//you should already have this
Option Private Module '//make code available to 'this' project only

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


Thanks a lot Garry for the response.
The 'Option Explicit' is always on, wasn't aware of the 'Option Private
Module'.

Regards,
Ludo


Glad to help! Best regards...

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


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
Add-In Visibility Trent Argante Excel Discussion (Misc queries) 5 February 13th 08 08:01 PM
Shared add-in UDF visibility Andrew Wiles Excel Programming 0 October 12th 07 09:49 AM
Find/Replace functions VERY slow when visibility = false erickras Excel Programming 3 August 3rd 06 10:42 PM
Worksheets - Visibility Doria/Warris Excel Programming 5 June 13th 04 08:46 AM
Visibility Gordon[_12_] Excel Programming 4 January 9th 04 08:04 PM


All times are GMT +1. The time now is 04:02 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"