+ Reply to Thread
Results 1 to 4 of 4

if exists code

  1. #1
    Registered User
    Join Date
    02-15-2007
    Location
    Inverness, UK
    Posts
    95

    if exists code

    How can i program this:

    If module2 exists then
    run first_start
    else
    dont do anything
    end if


    thanks very much

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    1) Go tools, references and select the "Microsoft Visual Basic For Applications Extensibility" library.

    2) Then you could do something like
    Please Login or Register  to view this content.
    Credit to http://www.cpearson.com/excel/vbe.htm for their reference.


    HTH

    rylo

  3. #3
    Registered User
    Join Date
    02-15-2007
    Location
    Inverness, UK
    Posts
    95
    i tried that, but it just didnt run the macro in the module at all, even when there

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Have a look at the attached file. The module macro1 contains the calling code. I've also got a module module3 that contains some dummy code.

    If you run the code aaa then nothing happens as there is no module2.

    However, if you select module3, view, Properties Window, change the name to module2, enter and then rerun the code aaa, then the message box should show.

    hth

    rylo
    Attached Files Attached Files
    Last edited by rylo; 04-26-2007 at 08:39 PM.

+ 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