Closed Thread
Results 1 to 3 of 3

Macro calling another Macro: "The macro 'Personal.xls!FindChar"

  1. #1
    William Benson
    Guest

    Macro calling another Macro: "The macro 'Personal.xls!FindChar"

    I did not get an answer that worked for me in an earlier post, am trying
    again - if someone can figure out what is wrong I would really appreciate
    it:

    I have a subprocedure shown below, in a module which is named CharStats, in
    Personal.xls:

    Public Sub FindChar()
    frmFindCharacters.Show
    End Sub

    I want the click event of command button on a sheet in another open workbook
    to call it, and wrote:

    Private Sub CommandButton1_Click()
    Application.Run "Personal.xls!FindChar"
    End Sub

    I am getting an error message saying : "The macro 'Personal.xls!FindChar'
    cannot be found.

    Pls help, thanks.

    "K Dales" <KDales@discussions.microsoft.com> wrote in message
    news:7DBDA864-9E44-4BE9-9E10-AF53105A1733@microsoft.com...
    >A sub to be Public to be used by any other module:
    > Public Sub OtherMacro()
    >
    > "William Benson" wrote:
    >
    >> I have a command button on Sheet1
    >> the click event says
    >> application.run "personal.xls!OtherMacro"
    >>
    >> The called macro is in a code module named "MyModule" in personal.xls. It
    >> is
    >> declared as
    >> Sub OtherMacro()
    >>
    >> I am getting an application error every time the click event fires, any
    >> ideas? TIA ... Bill
    >>
    >>
    >>





  2. #2
    Damien McBain
    Guest

    re: Macro calling another Macro: "The macro 'Personal.xls!FindChar"

    "William Benson" <wbenson1@nycap.rr.com> wrote in message
    news:%23tXd6U1aFHA.612@TK2MSFTNGP12.phx.gbl...
    >I did not get an answer that worked for me in an earlier post, am trying
    >again - if someone can figure out what is wrong I would really appreciate
    >it:
    >
    > I have a subprocedure shown below, in a module which is named CharStats,
    > in Personal.xls:
    >
    > Public Sub FindChar()
    > frmFindCharacters.Show
    > End Sub
    >
    > I want the click event of command button on a sheet in another open
    > workbook to call it, and wrote:
    >
    > Private Sub CommandButton1_Click()
    > Application.Run "Personal.xls!FindChar"
    > End Sub
    >
    > I am getting an error message saying : "The macro 'Personal.xls!FindChar'
    > cannot be found.


    How bout

    FindChar

    and shange the sub to just plain sub not private sub

    I'm not much of a techo but thats how I call other subroutines



  3. #3
    Tom Ogilvy
    Guest

    re: Macro calling another Macro: "The macro 'Personal.xls!FindChar"

    I copied your code from your posting and renamed the module in personal.xls
    to CharStats. Created a Userform in Personal.xls named frmFindCharacters.
    Added a commandbutton1 in another workbook and pasted your event code there.
    It worked fine for me.

    --
    Regards,
    Tom Ogilvy

    "William Benson" <wbenson1@nycap.rr.com> wrote in message
    news:%23tXd6U1aFHA.612@TK2MSFTNGP12.phx.gbl...
    > I did not get an answer that worked for me in an earlier post, am trying
    > again - if someone can figure out what is wrong I would really appreciate
    > it:
    >
    > I have a subprocedure shown below, in a module which is named CharStats,

    in
    > Personal.xls:
    >
    > Public Sub FindChar()
    > frmFindCharacters.Show
    > End Sub
    >
    > I want the click event of command button on a sheet in another open

    workbook
    > to call it, and wrote:
    >
    > Private Sub CommandButton1_Click()
    > Application.Run "Personal.xls!FindChar"
    > End Sub
    >
    > I am getting an error message saying : "The macro 'Personal.xls!FindChar'
    > cannot be found.
    >
    > Pls help, thanks.
    >
    > "K Dales" <KDales@discussions.microsoft.com> wrote in message
    > news:7DBDA864-9E44-4BE9-9E10-AF53105A1733@microsoft.com...
    > >A sub to be Public to be used by any other module:
    > > Public Sub OtherMacro()
    > >
    > > "William Benson" wrote:
    > >
    > >> I have a command button on Sheet1
    > >> the click event says
    > >> application.run "personal.xls!OtherMacro"
    > >>
    > >> The called macro is in a code module named "MyModule" in personal.xls.

    It
    > >> is
    > >> declared as
    > >> Sub OtherMacro()
    > >>
    > >> I am getting an application error every time the click event fires, any
    > >> ideas? TIA ... Bill
    > >>
    > >>
    > >>

    >
    >
    >




Closed 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