using powershell to automate some excel functions

I have a text file that is generated from a system.  I edit the file daily with a macro and submit my revised text file to the appropriate department.  I thought i had conquered my lazyness by getting my macro to work flawlessly.  i did not knoweth what i thinkethed at the time.  I need to be lazier.

This does not have to be powershell but i would like an icon (probably batch or ps) that i can double click and have excel open the text file.  edit the text file and then save it back out as a .prn file.  is there anyway to do this.
example.
i have a file called 1.txt    i have a xlsm file 2.xlsm that contains the macro...   CreateIntegrationFile
can i write a code that will open the 2.xlsm file, then run the create integration macro, and then save the results.
jamesmetcalf74Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

KimputerCommented:
Use this code for your VBscript:

Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\Users\Kimputer\Documents\2.xlsm")

objExcel.Application.Visible = True
objExcel.Application.Run "ThisWorkbook.CreateIntegrationFile"
objExcel.ActiveWorkbook.Close


objExcel.Application.Quit
WScript.Echo "Finished."
WScript.Quit

Open in new window


However, since you can see how simple this code is, have the 1.txt opening and saving be DONE already INSIDE the macro, so the vbscript can be simple.
Also, obviously, this is when the macro has been added in the ThisWorkbook region.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jamesmetcalf74Author Commented:
worked like a charm
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.