Hi All,
I need a vba code to copy all contents of a input text file and paste it in a command shell.. Please help me..
Thank you.
Hi All,
I need a vba code to copy all contents of a input text file and paste it in a command shell.. Please help me..
Thank you.
Maybe something like:
![]()
Sub macro_1() Shell "Cmd.exe /S /K " & createobject("Scripting.filesystemobject").opentextfile("E:\temp.txt").read End Sub
Hi Thanks for replying..
I used the code but getting wrong number of arguments or invalid property assignment error.. Pls help..
i am using below code
where rename file path is the file path from textbox.![]()
Shell "Cmd.exe /S /K " & CreateObject("Scripting.filesystemobject").OpenTextFile(renameFilePath).Read
Thanks
Read all method is working only for one line.. but i want it to process all lines![]()
Shell "Cmd.exe /S /K " & CreateObject("Scripting.filesystemobject").OpenTextFile(renameFilePath).ReadAll
Hi,
no needs a command shell, just read the VBA help of Name statement !
Maybe try:
![]()
Sub macro_1() Shell "Cmd.exe /S /K " & Replace(CreateObject("Scripting.filesystemobject").opentextfile("E:\test.txt").readall, vbNewLine, "") End Sub
With the txt file attached …
solved by changing the naming of the file from .txt to .bat and running it using Shell command.. Thanks all.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks