Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: How to start excel from a batch file

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

    Default

    Hi ,

    I have to open an excel file say RESULTS
    from a batch file. because i am scheduling the batch file to run automatically.

    Any thoughts.

  2. #2
    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

    Don't know how to write the batch, might be thew wrong site...but have you considered starting xl automatically with the windows task scheduler?

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

    Default

    yes, it is opening excel with scheduler. but i want a specific file to be opened.

  4. #4
    MrExcel MVP
    Join Date
    Apr 2002
    Location
    Vancouver BC , Canada
    Posts
    6,259
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    In your batch file just call the specific file ie.
    Code:
    call results.xls
    <MARQUEE>...........Never be afraid to try something new. Remember, amateurs built the ark, professionals built the Titanic...............The easiest thing to find is fault, don't be easy !.. --Anonymous--...</marquee>

  5. #5
    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

    Hi Nimrod. Is this how we write .bat files?

    In any case, to open a certain file on XL launch, copy the file or a shortcut of the file and paste it in your xlstart folder. Should be on your c: drive. Give it a search.

    _________________
    Cheers, NateO

    [ This Message was edited by: NateO on 2002-05-10 15:37 ]

  6. #6
    MrExcel MVP
    Join Date
    Apr 2002
    Location
    Vancouver BC , Canada
    Posts
    6,259
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi NateO !
    You write bat files in notepad or any other PlainText editor and then save with the extention ".bat".

    Same concept as writing a Kix or vbs script ... only the commands and syntax are different.
    ShortCuts are nothing more then one method of initiating a script... and there are many ways to initate scripts.
    <MARQUEE>...........Never be afraid to try something new. Remember, amateurs built the ark, professionals built the Titanic...............The easiest thing to find is fault, don't be easy !.. --Anonymous--...</marquee>

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

    Default

    nimrod,

    Call results.xls is working. but i am getting enable macros popup which i dont want to be asked.

    is there a way to suppress that

  8. #8
    MrExcel MVP
    Join Date
    Apr 2002
    Location
    Vancouver BC , Canada
    Posts
    6,259
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thru your toolbar ... tools...macro..security

    _________________
    NOTE: Testing performed on Win2K utilizing Office 2000. Solutions may need tweaking for other versions.

    [ This Message was edited by: Nimrod on 2002-05-10 15:45 ]

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

    Default

    thank everybody. its working

  10. #10
    MrExcel MVP
    Join Date
    Apr 2002
    Location
    Vancouver BC , Canada
    Posts
    6,259
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Another cool thing that you can do is actually open a office app. AND start running a particular macro.... I'm not sure what the switch is in excel but in word it's /m
    ie call word.exe /mMACRONAME

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
  •