×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Running Excel via batch mode from another program

Running Excel via batch mode from another program

Running Excel via batch mode from another program

(OP)
Has anyone successfully done this?  What I'd like to do is to call Excel from Ansys (my FEA program).  I would need to read in values from a text file into excel and then export the output data from excel.  I have envisioned doing this via macro but I would like to do this without opening the Excel GUI.  Is this possible?  I didn't see anything about batch mode in the Excel help.

Thanks in advance!
-Brian

RE: Running Excel via batch mode from another program

Are you processing the data at all in Excel?

Why not just save as .CSV format?

TTFN



RE: Running Excel via batch mode from another program

(OP)
Yes I will be processing the data in Excel.  I would like to have a workbook where I import the data from Ansys into say Column A of sheet 1.  I will then run a macro within Excel that writes the desired output to a file that i need to read back into Ansys.  Thanks!

-Brian

RE: Running Excel via batch mode from another program

It sounds doable.  Excel can be configured with a custom auto_open macro.  

TTFN



RE: Running Excel via batch mode from another program

(OP)
IRstuff,
Interesting...how does one go about executing an auto_open macro?

Thanks for all of your help!
-Brian

RE: Running Excel via batch mode from another program

It can also be done with Visual Basic.

RE: Running Excel via batch mode from another program

An auto_open (or nowadays Workbook_Open event procedure) is associated with a workbook, so it will run when you open that workbook. You can call Excel with a workbook name (and path) as a parameter ("startup switch"), and Excel will open that when it starts.

Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.

RE: Running Excel via batch mode from another program

I've never run Excel from another application but I have used Excel to run other applications (usually old fortran excecutable programs or similar programs). Or simply used Excel to act as a "post processor" to programs that generate scads of data similar to fea.

For example, I used to use Excel to generate input files to the old FAST2 program (used as basis for Welding Research Council bulletin 207), then run FAST2 using the "Shell" command. Then take the output file(s) and perform further processing for stresses and condensed/summarized reports. Nowadays my work doesn't call for this so much.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources