+ Reply to Thread
Results 1 to 10 of 10

Send Parameter Into Macro

Hybrid View

  1. #1
    Registered User
    Join Date
    12-23-2005
    Posts
    24

    Send Parameter Into Macro

    Hi

    I have a macro in which I will trigger it to run automatically, under windows scheduler. Eg:

    "D:\Data\Macro.xls".

    I am expecting to pass parameter in such way, which I did for my other exe application.

    "D:\Data\Macro.xls" parameter_1.

    I want the macro to read the parameter_1 in such way.

    No idea at all whether this is possible.

    Thanks.
    Last edited by ryanlcs; 10-31-2008 at 05:22 AM.

  2. #2
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    re: Send Parameter Into Macro

    Why not make a User Defined Function and place it in personal.xls. This way it is available to you (ALWAYS) and you can pass parameters at will.
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  3. #3
    Registered User
    Join Date
    12-23-2005
    Posts
    24
    I am not sure about what you mean. Can u pls elaborate more? thanks.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,444
    I don't think you can pass or read the command line parameters as you can with a standalone application.

    Can you write the parameter to a text file and get your macro to read the information from there?
    Cheers
    Andy
    www.andypope.info

  5. #5
    Registered User
    Join Date
    12-23-2005
    Posts
    24
    I am able to read from a text file.

    But actually my concern is that if this macro is a "scheduled" macro, then macro will handle it differently as compare to manual run. So, reading the parameter from text file doesnt solve it.

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,444
    Do you mean you don't want the code to execute if the workbook is opened manually rather than be the scheduler?

    In which case the existance of the text file can be used to determine whether a scheduled run is required.

    Or did you mean something else?

+ 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