Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Some help for inexperinced VBA users

  1. #11
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Where is this "test" macro situated? In a module in the same workbook? It should work, unless "test" is declared like this:


    Private Sub test()


    If it is, change "Private" to "Public".

    Or, if the macro isn't too long (I don't usually suggest this) just copy and paste the code into the "WorkBook_Open" event.

    _________________
    [b] Mark O'Brien

    [ This Message was edited by: Mark O'Brien on 2002-05-10 08:23 ]

  2. #12
    Board Regular
    Join Date
    Apr 2002
    Location
    Greenwood, SC
    Posts
    677
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Change the line test to:

    Application.Run ("KKMacros.xls!activepath")

    where KKMacros.xls is the name of your personal macro workbook and activepath is the name of the macro you want to run.

    As for auto scheduling, I believe you can use windows scheduling to handle this. I've not used it so cannot give much more info...

    K

  3. #13
    Legend NateO's Avatar
    Join Date
    Feb 2002
    Location
    Minneapolis, Mn, USA
    Posts
    9,700
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    You can call the private procedure from an event procedure if you call it the long way:

    Code:
    Application.Run ("test")

  4. #14
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Defeats the purpose of "Private" if you ask me then. (but let's not bicker about MS's philosophy, there are better things to bicker about, like animated smilies. )

  5. #15
    Legend NateO's Avatar
    Join Date
    Feb 2002
    Location
    Minneapolis, Mn, USA
    Posts
    9,700
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Not to be too arguementative , but, I think it depends who/what you want the procedure to be sheilded from, not your procedures, but from the macro dialog box.

    The windows task scheduler works fairly well. I've used it to launch excel on LAN login, which should fire a workbook_open procedure (not an auto_open procedure). Also, you can place files or shortcuts to files in your xlstart folder to launch upon Xl's launch.

  6. #16
    Board Regular
    Join Date
    May 2002
    Posts
    91
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I did the test macro with record macro feature. Is it ok?

  7. #17
    Legend NateO's Avatar
    Join Date
    Feb 2002
    Location
    Minneapolis, Mn, USA
    Posts
    9,700
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hard to say from Minneapolis. Did it work?

    You can record opening the file and saving it as something else (e.g., a cell value, a certain name, etc...) But you can record the workbook_open macro that calls the recorded macro from your personal.xls file. See Mark's post earlier on where to put it and the posts above on calling it

    application.run("personal.xls!MacroName")


    _________________
    Cheers, NateO

    [ This Message was edited by: NateO on 2002-05-10 09:06 ]

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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