+ Reply to Thread
Results 1 to 4 of 4

Passing arguments when opening Excel

  1. #1
    Registered User
    Join Date
    05-22-2006
    Posts
    3

    Passing arguments when opening Excel

    I've been looking all over the net for tips on how to pass command-line arguments to a worksheet.

    Many pages refer to a function in "kernel32" with a "Auto_open" sub, but all these apply to Excel 97!!!

    The "Command"-method doesn't seem to catch my arguments either...

    How can i start a workbook like this:

    \\server\share\folder\myworkbook.xls /param1 /param2 /param3

    ...and catch the params in my VBA macro?

    /David

  2. #2
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187
    Hi,

    your comments indicate that you cannot use Excel 97 code but you don't mention which version of Excel you are using.

    regards

  3. #3
    Registered User
    Join Date
    05-22-2006
    Posts
    3
    I use 2003.

    /David

  4. #4
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187
    I am not sure that you can do it directly in Excel. I would be glad to be proven wrong.

    To get the same effect write an Excel launcher in VB ; collect the command line and pass it to your launched excel application.

    I suspect you maybe able to do it in VBScript as well


    Hope this helps

+ 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