+ Reply to Thread
Results 1 to 4 of 4

what are command line arguments to run macro invisibly? and 2 more questions

  1. #1
    Registered User
    Join Date
    11-25-2008
    Location
    NYC
    Posts
    8

    what are command line arguments to run macro invisibly? and 2 more questions

    Hi all

    i have 3 questions.

    I want that excel will open a file (invisibly) and run a macro (then quit).
    all this using command line arguments. is it posibble?

    I use the SaveAs method to save the file
    in another name but i dont want it to save the file
    with the macro.how can i do that

    I want to lock my template in a way that the macro will be able
    add or delete rows to the template but no one can modify the first 3 rows
    and other things related to the template such as header and footer.

    thanx.
    Last edited by briana banks; 11-30-2008 at 02:27 AM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello briana banks,

    You can't start Excel invisibly using command line switched. You would need to create a script file with a .VBS file extension that contained the code necessary to start Excel invisibly, load your file, and run the macro. The VBS extension will run from the command line. What I am referring to is a VB Script file and not a VBA macro.

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    11-25-2008
    Location
    NYC
    Posts
    8
    Hi and thanks for replying

    Ok.then i'll write the vbs to open the excel file.
    however the macro within the excel file i'm opening contains the macro.
    i dont want that this macro will be transferred along with the new (SavedAs)
    file and will be available for editing for excel users.
    how can i do that?

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Stick to one question per thread, you will get better responses
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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