Hello,
I'm newbie in VBA/Macro and facing one problem.
I want to run few arguments in cmd together.
1. s:\
2. cd\reuters\rpdataadd
3. rpdataadd PATH=D:\temp\loadstuff ACQUIREDDATE=9/4/2012 USEFILENAMEASTITLE=TRUE PRESENTATIONDATE=9/4/2012 ENVIRONMENT=PRODUCTION
I'm using below code
Sub loadstuffl()
Shell "C:\Windows\system32\cmd.exe", vbNormalFocus 'opens CMD
Application.Wait (Now + TimeValue("0:00:05"))
' it will copy from sheet1 and range a1
SendKeys Sheets(1).Cells(31, 3).Value
Application.Wait (Now + TimeValue("0:00:02"))
SendKeys "{Enter}" 'enter code
ThisWorkbook.Activate
Sheets(1).Select
' it will copy from sheet1 and range a2
SendKeys Sheets(1).Cells(32, 3).Value
Application.Wait (Now + TimeValue("0:00:04"))
SendKeys "{Enter}" 'enter code
Application.Wait (Now + TimeValue("0:00:02"))
ThisWorkbook.Activate
Sheets(1).Select
' it will copy from sheet1 and range a2
SendKeys Sheets(1).Cells(33, 3).Value
Application.Wait (Now + TimeValue("0:00:08"))
SendKeys "{Enter}" 'enter code
Application.Wait (Now + TimeValue("0:00:08"))
End Sub
Problem I'm facing is, this is not sending whole text into cmd. for 3rd line it is only sending "ENVIRONMENT=PRODUCTION"
Also first two lines are also not delivering into cmd all time. means sometime it works and sometime its not.
I'm hoping to have answer from this thread.
Thanks,
Bookmarks