Find text files in the current folder and use each text file

May 17, 2016 at 23:42:55
Specs: Windows 7
Hi,
I am completely new to this and would appreciate any help.

I have to write a batch Script that finds *.txt files in PWD of the batch file,
I have to open each .txt in excel ,
after opening the TEXT file in Excel, I have written a MACRO in VBA, i have to run the Macro

can this be done using batch file or is there any alternative method to do this task

Thanks,

message edited by sob


See More: Find text files in the current folder and use each text file

Report •

#1
May 18, 2016 at 14:33:42
It can be done with VBScript, PowerShell, or any other language that can use COM. That excludes native batch scripts.

The real issue is the Excel macro. Macros are tied to workbooks, so you'll need to load the workbook that has your macro before you can run it. Not exactly hard, but at that point you might as well do your file selections from an Excel macro. Other option, if you're only using Excel as a VBA engine, you could just port your macro to VBScript.

How To Ask Questions The Smart Way


Report •
Related Solutions


Ask Question