+ Reply to Thread
Results 1 to 4 of 4

Can't specify the folder for the output of the batch file invoked by Excel VBA

  1. #1
    Registered User
    Join Date
    08-25-2012
    Location
    Ankara, Turkey
    MS-Off Ver
    Excel 2010
    Posts
    2

    Can't specify the folder for the output of the batch file invoked by Excel VBA

    Hi,

    I am trying to run a simple batch file that runs NASTRAN in a specified folder using Excel VBA. I directly use Shell command and it works fine, however the output files go directly to "My Documents" folder instead of the folder of the batch file itself.
    In other words, I cannot select the folder using the vba code.
    At previous versions I was using ShellExecute but it does not work with 64-bit as far as I see. Is there something that I can use instead of the one below:

    Please Login or Register  to view this content.
    Last edited by merthum; 08-25-2012 at 09:15 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,258

    Re: Can't specify the folder for the output of the batch file invoked by Excel VBA

    Hello merthum,

    Here is the 64-Bit version of ShellExecute
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    08-25-2012
    Location
    Ankara, Turkey
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Can't specify the folder for the output of the batch file invoked by Excel VBA

    Many thanks for the reply. It works perfectly.

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Can't specify the folder for the output of the batch file invoked by Excel VBA

    @ merthum

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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