+ Reply to Thread
Results 1 to 9 of 9

Public function in Personal.xls

  1. #1
    Ardus Petus
    Guest

    Public function in Personal.xls

    I have a series of utility functions in Personal.xls

    I know how to call them from a worksheet cell.

    What is the syntax to call them from VBA code?

    TIA,
    --
    AP



  2. #2
    Bob Phillips
    Guest

    Re: Public function in Personal.xls

    Look at Application.Run in help, or set a reference to Personal.xls in your
    workbook, then you could call them as if they were locakl to your workbook.

    --

    HTH

    Bob Phillips

    (replace xxxx in the email address with gmail if mailing direct)

    "Ardus Petus" <[email protected]> wrote in message
    news:[email protected]...
    > I have a series of utility functions in Personal.xls
    >
    > I know how to call them from a worksheet cell.
    >
    > What is the syntax to call them from VBA code?
    >
    > TIA,
    > --
    > AP
    >
    >




  3. #3
    Ardus Petus
    Guest

    Re: Public function in Personal.xls

    Application.Run is OK for a Sub, not a Function.

    Setting a reference to Personal.xls fails: "Module name, project name or
    library name already in use"

    Cheers
    --
    AP

    "Bob Phillips" <[email protected]> a écrit dans le message de news:
    [email protected]...
    > Look at Application.Run in help, or set a reference to Personal.xls in
    > your
    > workbook, then you could call them as if they were locakl to your
    > workbook.
    >
    > --
    >
    > HTH
    >
    > Bob Phillips
    >
    > (replace xxxx in the email address with gmail if mailing direct)
    >
    > "Ardus Petus" <[email protected]> wrote in message
    > news:[email protected]...
    >> I have a series of utility functions in Personal.xls
    >>
    >> I know how to call them from a worksheet cell.
    >>
    >> What is the syntax to call them from VBA code?
    >>
    >> TIA,
    >> --
    >> AP
    >>
    >>

    >
    >




  4. #4
    Joergen Bondesen
    Guest

    Re: Public function in Personal.xls

    Hi Bob

    > set a reference to Personal.xls in your workbook

    Are you sure about this, because I can not find Personal in Excel 2003
    reference.
    What must I look for?

    --
    Best regards
    Joergen Bondesen


    "Bob Phillips" <[email protected]> wrote in message
    news:[email protected]...
    > Look at Application.Run in help, or set a reference to Personal.xls in
    > your
    > workbook, then you could call them as if they were locakl to your
    > workbook.
    >
    > --
    >
    > HTH
    >
    > Bob Phillips
    >
    > (replace xxxx in the email address with gmail if mailing direct)
    >
    > "Ardus Petus" <[email protected]> wrote in message
    > news:[email protected]...
    >> I have a series of utility functions in Personal.xls
    >>
    >> I know how to call them from a worksheet cell.
    >>
    >> What is the syntax to call them from VBA code?
    >>
    >> TIA,
    >> --
    >> AP




  5. #5
    Bob Phillips
    Guest

    Re: Public function in Personal.xls


    "Ardus Petus" <[email protected]> wrote in message
    news:[email protected]...
    > Application.Run is OK for a Sub, not a Function.


    Not correct, it works just as well on a function

    MsgBox Application.Run("Personal.xls!testrun", "aok")

    I

    > Setting a reference to Personal.xls fails: "Module name, project name or
    > library name already in use"


    Not on my system it doesn't, works fine. You might need to name the
    Personal.xls project something meaningful so that you can find it in the
    list.



  6. #6
    Bob Phillips
    Guest

    Re: Public function in Personal.xls

    Yes I am sure, it is just another workbook and it can be referenced as such.
    As long as you have a Personal.xls (and that is not a given, it has to be
    created), you should see it in the list of references. As I mentioned to
    Ardus, you may need to change the project name in Properties, so that it is
    unique, and identifiable in the list.

    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "Joergen Bondesen" <[email protected]> wrote in message
    news:[email protected]...
    > Hi Bob
    >
    > > set a reference to Personal.xls in your workbook

    > Are you sure about this, because I can not find Personal in Excel 2003
    > reference.
    > What must I look for?
    >
    > --
    > Best regards
    > Joergen Bondesen
    >
    >
    > "Bob Phillips" <[email protected]> wrote in message
    > news:[email protected]...
    > > Look at Application.Run in help, or set a reference to Personal.xls in
    > > your
    > > workbook, then you could call them as if they were locakl to your
    > > workbook.
    > >
    > > --
    > >
    > > HTH
    > >
    > > Bob Phillips
    > >
    > > (replace xxxx in the email address with gmail if mailing direct)
    > >
    > > "Ardus Petus" <[email protected]> wrote in message
    > > news:[email protected]...
    > >> I have a series of utility functions in Personal.xls
    > >>
    > >> I know how to call them from a worksheet cell.
    > >>
    > >> What is the syntax to call them from VBA code?
    > >>
    > >> TIA,
    > >> --
    > >> AP

    >
    >




  7. #7
    Ardus Petus
    Guest

    Re: Public function in Personal.xls

    That was it: I renamed VBA Project into Perso, and I could set a reference
    to it.

    Thanks for all,
    --
    AP

    "Bob Phillips" <[email protected]> a écrit dans le message de news:
    [email protected]...
    >
    > "Ardus Petus" <[email protected]> wrote in message
    > news:[email protected]...
    >> Application.Run is OK for a Sub, not a Function.

    >
    > Not correct, it works just as well on a function
    >
    > MsgBox Application.Run("Personal.xls!testrun", "aok")
    >
    > I
    >
    >> Setting a reference to Personal.xls fails: "Module name, project name or
    >> library name already in use"

    >
    > Not on my system it doesn't, works fine. You might need to name the
    > Personal.xls project something meaningful so that you can find it in the
    > list.
    >
    >




  8. #8
    Joergen Bondesen
    Guest

    Re: Public function in Personal.xls

    Hi Bob

    It works perfect now.
    Thanks for your patience.

    --
    Best regards
    Joergen Bondesen


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Yes I am sure, it is just another workbook and it can be referenced as
    > such.
    > As long as you have a Personal.xls (and that is not a given, it has to be
    > created), you should see it in the list of references. As I mentioned to
    > Ardus, you may need to change the project name in Properties, so that it
    > is
    > unique, and identifiable in the list.
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (replace somewhere in email address with gmail if mailing direct)
    >
    > "Joergen Bondesen" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hi Bob
    >>
    >> > set a reference to Personal.xls in your workbook

    >> Are you sure about this, because I can not find Personal in Excel 2003
    >> reference.
    >> What must I look for?
    >>
    >> --
    >> Best regards
    >> Joergen Bondesen
    >>
    >>
    >> "Bob Phillips" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > Look at Application.Run in help, or set a reference to Personal.xls in
    >> > your
    >> > workbook, then you could call them as if they were locakl to your
    >> > workbook.
    >> >
    >> > --
    >> >
    >> > HTH
    >> >
    >> > Bob Phillips
    >> >
    >> > (replace xxxx in the email address with gmail if mailing direct)
    >> >
    >> > "Ardus Petus" <[email protected]> wrote in message
    >> > news:[email protected]...
    >> >> I have a series of utility functions in Personal.xls
    >> >>
    >> >> I know how to call them from a worksheet cell.
    >> >>
    >> >> What is the syntax to call them from VBA code?
    >> >>
    >> >> TIA,
    >> >> --
    >> >> AP

    >>
    >>

    >
    >




  9. #9
    Dave Peterson
    Guest

    Re: Public function in Personal.xls

    I think you should try application.run using a function.

    I bet it works.



    Ardus Petus wrote:
    >
    > Application.Run is OK for a Sub, not a Function.
    >
    > Setting a reference to Personal.xls fails: "Module name, project name or
    > library name already in use"
    >
    > Cheers
    > --
    > AP
    >
    > "Bob Phillips" <[email protected]> a écrit dans le message de news:
    > [email protected]...
    > > Look at Application.Run in help, or set a reference to Personal.xls in
    > > your
    > > workbook, then you could call them as if they were locakl to your
    > > workbook.
    > >
    > > --
    > >
    > > HTH
    > >
    > > Bob Phillips
    > >
    > > (replace xxxx in the email address with gmail if mailing direct)
    > >
    > > "Ardus Petus" <[email protected]> wrote in message
    > > news:[email protected]...
    > >> I have a series of utility functions in Personal.xls
    > >>
    > >> I know how to call them from a worksheet cell.
    > >>
    > >> What is the syntax to call them from VBA code?
    > >>
    > >> TIA,
    > >> --
    > >> AP
    > >>
    > >>

    > >
    > >


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1