+ Reply to Thread
Results 1 to 7 of 7

Why wont it work?

  1. #1
    Bobby
    Guest

    Why wont it work?

    Help!
    I want to start automaticaly a macro or SUB in ThisWorkbook. This is my
    code :

    Private Sub Workbook_Open()
    slist
    End Sub

    It keep's telling me that a variable or procedure is wanted and not a
    module(slist is a module)! Where do I go wrong! This is driving me!(I
    did try many things so far with no result)


  2. #2
    Bob Phillips
    Guest

    Re: Why wont it work?

    You should be referring to the macro in that module, not the module itself.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Bobby" <[email protected]> wrote in message
    news:[email protected]...
    > Help!
    > I want to start automaticaly a macro or SUB in ThisWorkbook. This is my
    > code :
    >
    > Private Sub Workbook_Open()
    > slist
    > End Sub
    >
    > It keep's telling me that a variable or procedure is wanted and not a
    > module(slist is a module)! Where do I go wrong! This is driving me!(I
    > did try many things so far with no result)
    >




  3. #3
    Norman Jones
    Guest

    Re: Why wont it work?

    Hi Bobby,

    What is the name of the macro that you want to run and where is it housed?


    ---
    Regards,
    Norman


    "Bobby" <[email protected]> wrote in message
    news:[email protected]...
    > Help!
    > I want to start automaticaly a macro or SUB in ThisWorkbook. This is my
    > code :
    >
    > Private Sub Workbook_Open()
    > slist
    > End Sub
    >
    > It keep's telling me that a variable or procedure is wanted and not a
    > module(slist is a module)! Where do I go wrong! This is driving me!(I
    > did try many things so far with no result)
    >




  4. #4
    Bobby
    Guest

    Re: Why wont it work?

    Norman the module name is: slist(was module1 before I rename it) and it
    is located in the current WorBook


  5. #5
    Dave Peterson
    Guest

    Re: Why wont it work?

    Put it back in Module1.

    But inside that module1, there's a:

    Sub XXXXX()

    What's the name of the procedure you want to run?

    (It follows the word Sub.)

    Bobby wrote:
    >
    > Norman the module name is: slist(was module1 before I rename it) and it
    > is located in the current WorBook


    --

    Dave Peterson

  6. #6
    Bobby
    Guest

    Re: Why wont it work?

    The Sub name is: slist or
    Sub slist()


  7. #7
    Norman Jones
    Guest

    Re: Why wont it work?

    Hi Bobby,

    If you name a macro and a module with the same name, you will confuse VBA:
    Change the name of the module (as suggested by Dave) and all should be well.


    ---
    Regards,
    Norman



    "Bobby" <[email protected]> wrote in message
    news:[email protected]...
    > The Sub name is: slist or
    > Sub slist()
    >




+ 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