Robertson1995
Board Regular
- Joined
- Apr 1, 2009
- Messages
- 123
I have a program called Reflections WRQ that I need to run a command and have the results dump into an Excel worksheet. I am using the below code and its working, but here's the problem I'm having. When I run the command a second time, it does not overwrite the data from the first time I ran it. Instead it adds to it. I need it to overwrite every time. Thanks in advance.
Sub logs()
CR = Chr$(rcCR)
Session.PrintToFile = "C:\EVDO Test Logs.xls"
Session.PrinterLogging = True
With Session
Wait 1
.Transmit "cd /appdata/logs" & CR
Wait 2
.Transmit "grep DOM_10.249.185.3/ alert_audit*" & CR
Wait 1
End With
Session.PrinterLogging = False
End
End Sub
Sub logs()
CR = Chr$(rcCR)
Session.PrintToFile = "C:\EVDO Test Logs.xls"
Session.PrinterLogging = True
With Session
Wait 1
.Transmit "cd /appdata/logs" & CR
Wait 2
.Transmit "grep DOM_10.249.185.3/ alert_audit*" & CR
Wait 1
End With
Session.PrinterLogging = False
End
End Sub