WScript.Echo("This is a pop up")
Thursday, April 25, 2013
Monday, May 21, 2012
How many Cell is filled in Row
Having the ability to check the length of Row will give you the option to run script for the list of items in your EXCEL spreadsheet
Here we are checking the current Spreadsheet’s Row A length and declared “LastRow” for future reference
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
Check file exist
Here is how to check for file exist while we copy to or from machine’s data
Example below show the checking of CMD.exe in Windows\system32 folder
'Set Object
Set fso = CreateObject("Scripting.FileSystemObject")
'Create Condition
If (fso.FileExists("C:\windows\system32\cmd.exe")) Then
'Alert User
WScript.Echo("File exists!")
WScript.Quit()
Else
'Alert User
WScript.Echo("File does not exist!")
End If
'Exit Script
WScript.Quit()
Check folder Existence
Checking of folder existence to minimise extra step in your script.
Below is an example to check for C:\Windows folder
set objDRV = CreateObject("Scripting.FileSystemObject")
If objDRV.FolderExists("c:\windows") Then
(DO SOMETHING)
else
(DO ANOTHER THING)
End if