Results 1 to 2 of 2

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

Threaded View

  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:

    sFile = "D:\Specified_Folder\batchfilefornastran.bat"
    sDefaultDir = "D:\Specified_Folder"
    li = ShellExecute(hWnd, "open", sFile, vbNullString, sDefaultDir, 1)
    Last edited by merthum; 08-25-2012 at 07:37 AM.

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