├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── Date Operations ├── Add Or Substract From Date │ ├── AddOrSubstractFromDate.vbs │ └── README.MD └── Date Comparison │ ├── Date Comparison.vbs │ └── README.md ├── Excel Operations ├── Compare Two Excels Files As Sheet │ ├── CompareTwoExcelFilesAsSheets.vbs │ └── README.md ├── Convert XLSX To XLS │ ├── ConvertXlsxToXls.vbs │ └── README.md ├── Copy Specific Range │ ├── CopySpecificRange.vbs │ └── README.md ├── Create Excel Sheet Xlsx │ ├── CreateExcelSheetAsXlsx.vbs │ └── README.md ├── Delete Excel Sheet │ ├── DeleteExcelSheet.vbs │ └── README.md ├── Excel Column Letter To Number │ ├── ExcelColumnLetterToNumber.vbs │ └── README.md ├── Excel Save As │ ├── ExcelSaveAs.vbs │ └── README.md ├── Excel To CSV │ ├── ExcelToCsv.vbs │ └── README.md └── Is Row Empty │ ├── README.md │ └── isRowEmpty.vbs ├── Files Operations ├── Check File Accessed Date Between Range Date │ ├── CheckFileAccessedDateBetweenRangeDate.vbs │ └── README.md ├── Check File Created Date Between Range Date │ ├── CheckFileCreatedDateBetweenRangeDate.vbs │ └── README.md ├── Check File Modified Date Between Range Date │ ├── CheckFileModifiedDateBetweenRangeDate.vbs │ └── README.md └── Get All Files In Folder │ ├── GetAllFilesInFolder.vbs │ └── README.md ├── LICENSE ├── Numbers Operations ├── Liner Calculator │ ├── LinerCalculator.vbs │ └── README.md └── Number To Double │ ├── NumberToDouble.vbs │ └── README.md ├── README.md ├── Scripts ├── CheckFileModifiedDate.vbs ├── CreateExcelSheetAsXlsx.vbs └── SplitTiffImages.vbs ├── String Operations └── Count Character Occurrences │ ├── CountCharacterOccurrences.vbs │ └── README.md └── _template.vbs /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. Windows 10 Pro] 28 | - Version [e.g. 22] 29 | - Browser [e.g. chrome, safari] 30 | 31 | **Additional context** 32 | Add any other context about the problem here. 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /Date Operations/Add Or Substract From Date/AddOrSubstractFromDate.vbs: -------------------------------------------------------------------------------- 1 | InputDate = WScript.Arguments.Item(0) 2 | Value = WScript.Arguments.Item(1) 3 | Interval = WScript.Arguments.Item(2) 4 | Result = DateAdd(Interval, Value, InputDate) 5 | 'WScript.StdOut.Write(Result) 6 | MsgBox(Result) -------------------------------------------------------------------------------- /Date Operations/Add Or Substract From Date/README.MD: -------------------------------------------------------------------------------- 1 | **Input1 InputDate (String):** Input date in the machine date format. 2 | **Input2 Value (String):** The operation value could be either positive or negative. 3 | **Input3 Interval (String):** A Variant or literal representing the date to which interval is added. 4 | **Output Date (String):** The result of the date operation. 5 | 6 | **Example:** `"01/04/2019" 5 d` 7 | 8 | **Interval Types:** https://www.w3schools.com/asp/func_dateadd.asp 9 | 10 | | Interval | Description | 11 | |----------|--------------| 12 | | yyyy | Year | 13 | | m | Month | 14 | | d | Day | 15 | | h | Hour | 16 | | n | Minute | 17 | | s | Second | 18 | | q | Quarter | 19 | | y | Day of year | 20 | | w | Weekday | 21 | | ww | Week of year | 22 | 23 | 24 | **Important Notes:** 25 | The date format depends on date format, you can change from region settings. 26 | For Automation Anywhere separate the parameters with space. 27 | If any input has space surround it with quotations. 28 | 29 | **MIT License** 30 | **Copyright (c) 2019 Khaled Mostafa** 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Date Operations/Date Comparison/Date Comparison.vbs: -------------------------------------------------------------------------------- 1 | Input = WScript.Arguments.Item(0) 2 | StartDate = WScript.Arguments.Item(1) 3 | EndDate = WScript.Arguments.Item(2) 4 | 5 | If (Input >= StartDate AND Input <= EndDate) Then 6 | Result = 1 7 | Else 8 | Result = 0 9 | End If 10 | WScript.StdOut.Write(Result) -------------------------------------------------------------------------------- /Date Operations/Date Comparison/README.md: -------------------------------------------------------------------------------- 1 | **Input1 InputDate (String):** The Input date. 2 | **Input2 StartDate (String):** The start date. 3 | **Input3 EndDate (String):** The end date. 4 | **Output Boolean (String):** `0 = Out of Range , 1 = In Range` 5 | 6 | **Example:** ` "10/06/2019" "01/06/2019" "15/06/2019"` 7 | 8 | **Important Note:** The date format depends on date format, you can change from region settings. 9 | 10 | **Note:** For Automation Anywhere separate the parameters with space. 11 | **Note:** If any input has space surround it with quotations. 12 | 13 | **MIT License** 14 | **Copyright (c) 2019 Khaled Mostafa** 15 | -------------------------------------------------------------------------------- /Excel Operations/Compare Two Excels Files As Sheet/CompareTwoExcelFilesAsSheets.vbs: -------------------------------------------------------------------------------- 1 | Set xl = CreateObject("Excel.Application") 2 | xl.Visible = "False" 3 | Set Compare1 = xl.Workbooks.Open(Wscript.Arguments(0)) 4 | Set Compare2 = xl.Workbooks.Open(Wscript.Arguments(2)) 5 | 6 | Set CompareSheet1 = Compare1.Sheets(Wscript.Arguments(1)) 7 | Set compareSheet2 = Compare2.Sheets(Wscript.Arguments(3)) 8 | 9 | For Each Cell In CompareSheet1.UsedRange 10 | If Cell.Value <> compareSheet2.Range(Cell.Address).Value Then 11 | ' highlight the cell if mismatch exist 12 | Cell.Interior.ColorIndex = 6 13 | End If 14 | Next 15 | Compare1.Save 16 | Compare2.Save 17 | Compare1.Close 18 | Compare2.Close -------------------------------------------------------------------------------- /Excel Operations/Compare Two Excels Files As Sheet/README.md: -------------------------------------------------------------------------------- 1 | **Input1 FilePath1 (String):** Full file path with extension as a parameter. 2 | **Input2 SheetName1 (String):** Sheet Name of FilePath1. 3 | **Input3 FilePath2 (String):** Full file path with extension as a parameter. 4 | **Input4 SheetName2 (String):** Sheet Name of FilePath2. 5 | **Output (String):** N/A. 6 | 7 | **Example:** `"C:\Users\Khaled\Desktop\Book1.xlsx" "Sheet1" "C:\Users\Khaled\Desktop\Book2.xlsx" "Sheet1"` 8 | 9 | **Note:** For Automation Anywhere separate the parameters with space. 10 | **Note:** If any input has space surround it with quotations. 11 | 12 | **MIT License** 13 | **Copyright (c) 2019 Khaled Mostafa** -------------------------------------------------------------------------------- /Excel Operations/Convert XLSX To XLS/ConvertXlsxToXls.vbs: -------------------------------------------------------------------------------- 1 | Set objExcel = CreateObject("Excel.Application") 2 | Set objWorkbook = objExcel.Workbooks.Open(Wscript.Arguments(0)) 3 | objExcel.Application.Visible = False 4 | objExcel.Application.DisplayAlerts = False 5 | objExcel.ActiveWorkbook.SaveAs Wscript.Arguments(1), 56 6 | objExcel.ActiveWorkbook.Close 7 | objExcel.Application.DisplayAlerts = True 8 | objExcel.Application.Quit 9 | WScript.Quit -------------------------------------------------------------------------------- /Excel Operations/Convert XLSX To XLS/README.md: -------------------------------------------------------------------------------- 1 | **Input1 (String):** Full file path with extension XLSX. 2 | **Input2 (String):** Full file path with extension XLS. 3 | **Output (String):** N/A. 4 | 5 | **Example:** `"C:\Users\Khaled\Desktop\Book1.xlsx" "C:\Users\Khaled\Desktop\Book1.xls"` 6 | 7 | **Note:** For Automation Anywhere separate the parameters with space. 8 | **Note:** If any input has space surround it with quotations. 9 | 10 | **MIT License** 11 | **Copyright (c) 2019 Khaled Mostafa** -------------------------------------------------------------------------------- /Excel Operations/Copy Specific Range/CopySpecificRange.vbs: -------------------------------------------------------------------------------- 1 | Dim appXL 2 | Dim wbSource 3 | Dim wbDest 4 | Dim wksSource 5 | Dim wksDest 6 | Set appXL = CreateObject("Excel.Application") 7 | appXL.Visible = True 8 | Set wbSource = appXL.Workbooks.Open(WScript.Arguments.Item(0)) 9 | Set wksSource = wbSource.Worksheets(WScript.Arguments.Item(1)) 10 | Set wbDest = appXL.Workbooks.Open(WScript.Arguments.Item(3)) 11 | Set wksDest = wbDest.Worksheets(WScript.Arguments.Item(4)) 12 | 13 | wksDest.Range(WScript.Arguments.Item(5)).Value = wksSource.Range(WScript.Arguments.Item(2)).Value 14 | 15 | wbDest.Close True 16 | wbSource.Close False 17 | appXL.Quit 18 | 19 | Set appXL = Nothing 20 | Set wbSource = Nothing 21 | Set wksSource = Nothing 22 | Set wbDest = Nothing 23 | Set wksDest = Nothing 24 | WScript.Quit 25 | 26 | 27 | -------------------------------------------------------------------------------- /Excel Operations/Copy Specific Range/README.md: -------------------------------------------------------------------------------- 1 | **Input1 SourceFilePath (String):** Full file path with extension. 2 | **Input2 SourceSheet (String):** Sheet Name of the source. 3 | **Input3 SourceRange (String):** Range from:to of the source. 4 | **Input4 DestFilePath (String):** Full file path with extension. 5 | **Input5 DestSheet (String):** Sheet Name of the source. 6 | **Input6 DestRange (String):** Range from:to of the source. 7 | **Output (String):** Status. 8 | 9 | **Example:** `"C:\Users\Khaled\Desktop\Test\Book1.xlsx" Sheet1 A1:C4 "C:\Users\Khaled\Desktop\Test\Book2.xlsx" Sheet1 A1:C4` 10 | 11 | **Note:** For Automation Anywhere separate the parameters with space. 12 | **Note:** If any input has space surround it with quotations. 13 | 14 | **MIT License** 15 | **Copyright (c) 2019 Khaled Mostafa** -------------------------------------------------------------------------------- /Excel Operations/Create Excel Sheet Xlsx/CreateExcelSheetAsXlsx.vbs: -------------------------------------------------------------------------------- 1 | 'Developed and Edited by Khaled Mostafa 2 | ' 3 | '####### Usage ####### 4 | 'Input (String): Full file path with extension as a parameter and without quotations 5 | 'Example: Input: C:\Users\Khaled\Desktop\Test.xlsx 6 | ' 7 | '####### License ####### 8 | 'MIT License 9 | 'Copyright (c) 2019 Khaled Mostafa 10 | 'For More info: https://github.com/KhaledMostafaME 11 | 12 | strFileName = WScript.Arguments.Item(0) 13 | Set objExcel = CreateObject("Excel.Application") 14 | Set objWorkbook = objExcel.Workbooks.Add() 15 | objWorkbook.SaveAs(strFileName) 16 | objExcel.Quit -------------------------------------------------------------------------------- /Excel Operations/Create Excel Sheet Xlsx/README.md: -------------------------------------------------------------------------------- 1 | **Input (String):** Full file path with extension. 2 | **Output (String):** Excel Sheet. 3 | 4 | **Example:** `"C:\Users\Khaled\Desktop\Test\Book1.xlsx"` 5 | 6 | **Note:** For Automation Anywhere separate the parameters with space. 7 | **Note:** If any input has space surround it with quotations. 8 | 9 | **MIT License** 10 | **Copyright (c) 2019 Khaled Mostafa** -------------------------------------------------------------------------------- /Excel Operations/Delete Excel Sheet/DeleteExcelSheet.vbs: -------------------------------------------------------------------------------- 1 | Set objFSO = CreateObject("Scripting.FileSystemObject") 2 | src_file = objFSO.GetAbsolutePathName(Wscript.Arguments.Item(0)) 3 | sheetname = Wscript.Arguments.Item(1) 4 | Dim oExcel 5 | Set oExcel = CreateObject("Excel.Application") 6 | Dim oBook 7 | Set oBook = oExcel.Workbooks.Open(src_file) 8 | oExcel.DisplayAlerts = False 9 | oExcel.ScreenUpdating = False 10 | oBook.sheets(sheetname).Delete 11 | oBook.save 12 | oBook.close 13 | oExcel.DisplayAlerts = True 14 | oExcel.ScreenUpdating = True 15 | oExcel.Quit -------------------------------------------------------------------------------- /Excel Operations/Delete Excel Sheet/README.md: -------------------------------------------------------------------------------- 1 | **Input1 FilePath (String):** Full file path with extension as a parameter. 2 | **Input2 SheetName (String):** Sheet Name. 3 | **Output (String):** N/A. 4 | 5 | **Example:** `"C:\Users\Khaled\Desktop\Book1.xlsx" "Sheet2"` 6 | 7 | **Note:** For Automation Anywhere separate the parameters with space. 8 | **Note:** If any input has space surround it with quotations. 9 | 10 | **MIT License** 11 | **Copyright (c) 2019 Khaled Mostafa** -------------------------------------------------------------------------------- /Excel Operations/Excel Column Letter To Number/ExcelColumnLetterToNumber.vbs: -------------------------------------------------------------------------------- 1 | Dim i, col, Input, Output 2 | Input = WScript.Arguments.Item(0) 3 | For i = Len(Input) To 1 Step -1 4 | col = col + (Asc(Mid(Input, i, 1)) - 64) * (26 ^ (i - 1)) 5 | Next 6 | Output = col 7 | WScript.StdOut.Write(Output) 8 | 'Thanks to https://stackoverflow.com/a/15637514/6906583 -------------------------------------------------------------------------------- /Excel Operations/Excel Column Letter To Number/README.md: -------------------------------------------------------------------------------- 1 | **Input1 ColumnLetter (String):** The letter of the column. 2 | **Output ColumnNumber (String):** The number of the column. 3 | 4 | **Example:** `"E"` 5 | 6 | **Note:** For Automation Anywhere separate the parameters with space. 7 | **Note:** If any input has space surround it with quotations. 8 | 9 | **MIT License** 10 | **Copyright (c) 2019 Khaled Mostafa** -------------------------------------------------------------------------------- /Excel Operations/Excel Save As/ExcelSaveAs.vbs: -------------------------------------------------------------------------------- 1 | InputFile = Wscript.Arguments(0) 2 | SheetName = Wscript.Arguments(1) 3 | OutputFile = Wscript.Arguments(2) 4 | Ext = Wscript.Arguments(3) 5 | Set objExcel = CreateObject("Excel.application") 6 | objExcel.application.visible=false 7 | objExcel.application.displayalerts=false 8 | set objExcelBook = objExcel.Workbooks.Open(InputFile) 9 | objExcel.Sheets(SheetName).Select 10 | objExcelBook.SaveAs OutputFile, Ext 11 | objExcel.Application.Quit 12 | objExcel.Quit 13 | -------------------------------------------------------------------------------- /Excel Operations/Excel Save As/README.md: -------------------------------------------------------------------------------- 1 | **Input1 InputFile (String):** Full file path with extension as a parameter. 2 | **Input2 SheetName (String):** Sheet Name. 3 | **Input3 OutputFile (String):** Full file path with or without as a parameter. 4 | **Input4 Extension (String):** The code of the extension from the below table. 5 | 6 | **Example (Save As CSV):** `"C:\Users\Khaled\Desktop\Book1.xlsx" "Sheet1" "C:\Users\Khaled\Desktop\Book3" "23"` 7 | 8 | **Type of Extension** 9 | 10 | | Name | Value | Description | Extension | 11 | |-------------------------------|-----------|-------------------------------------------|--------------------------| 12 | | xlAddIn | 18 | Microsoft Excel 97-2003 Add-In | *.xla | 13 | | xlAddIn8 | 18 | Microsoft Excel 97-2003 Add-In | *.xla | 14 | | xlCSV | 6 | CSV | *.csv | 15 | | xlCSVMac | 22 | Macintosh CSV | *.csv | 16 | | xlCSVMSDOS | 24 | MSDOS CSV | *.csv | 17 | | xlCSVUTF8 | 62 | UTF8 CSV | *.csv | 18 | | xlCSVWindows | 23 | Windows CSV | *.csv | 19 | | xlCurrentPlatformText | -4158 | Current Platform Text | *.txt | 20 | | xlDBF2 | 7 | Dbase 2 format | *.dbf | 21 | | xlDBF3 | 8 | Dbase 3 format | *.dbf | 22 | | xlDBF4 | 11 | Dbase 4 format | *.dbf | 23 | | xlDIF | 9 | Data Interchange format | *.dif | 24 | | xlExcel12 | 50 | Excel Binary Workbook | *.xlsb | 25 | | xlExcel2 | 16 | Excel version 2.0 (1987) | *.xls | 26 | | xlExcel2FarEast | 27 | Excel version 2.0 far east (1987) | *.xls | 27 | | xlExcel3 | 29 | Excel version 3.0 (1990) | *.xls | 28 | | xlExcel4 | 33 | Excel version 4.0 (1992) | *.xls | 29 | | xlExcel4Workbook | 35 | Excel version 4.0. Workbook format (1992) | *.xlw | 30 | | xlExcel5 | 39 | Excel version 5.0 (1994) | *.xls | 31 | | xlExcel7 | 39 | Excel 95 (version 7.0) | *.xls | 32 | | xlExcel8 | 56 | Excel 97-2003 Workbook | *.xls | 33 | | xlExcel9795 | 43 | Excel version 95 and 97 | *.xls | 34 | | xlHtml | 44 | HTML format | *.htm; *.html | 35 | | xlIntlAddIn | 26 | International Add-In | No file extension | 36 | | xlIntlMacro | 25 | International Macro | No file extension | 37 | | xlOpenDocumentSpreadsheet | 60 | OpenDocument Spreadsheet | *.ods | 38 | | xlOpenXMLAddIn | 55 | Open XML Add-In | *.xlam | 39 | | xlOpenXMLStrictWorkbook | 61 (&H3D) | Strict Open XML file | *.xlsx | 40 | | xlOpenXMLTemplate | 54 | Open XML Template | *.xltx | 41 | | xlOpenXMLTemplateMacroEnabled | 53 | Open XML Template Macro Enabled | *.xltm | 42 | | xlOpenXMLWorkbook | 51 | Open XML Workbook | *.xlsx | 43 | | xlOpenXMLWorkbookMacroEnabled | 52 | Open XML Workbook Macro Enabled | *.xlsm | 44 | | xlSYLK | 2 | Symbolic Link format | *.slk | 45 | | xlTemplate | 17 | Excel Template format | *.xlt | 46 | | xlTemplate8 | 17 | Template 8 | *.xlt | 47 | | xlTextMac | 19 | Macintosh Text | *.txt | 48 | | xlTextMSDOS | 21 | MSDOS Text | *.txt | 49 | | xlTextPrinter | 36 | Printer Text | *.prn | 50 | | xlTextWindows | 20 | Windows Text | *.txt | 51 | | xlUnicodeText | 42 | Unicode Text | No file extension; *.txt | 52 | | xlWebArchive | 45 | Web Archive | *.mht; *.mhtml | 53 | | xlWJ2WD1 | 14 | Japanese 1-2-3 | *.wj2 | 54 | | xlWJ3 | 40 | Japanese 1-2-3 | *.wj3 | 55 | | xlWJ3FJ3 | 41 | Japanese 1-2-3 format | *.wj3 | 56 | | xlWK1 | 5 | Lotus 1-2-3 format | *.wk1 | 57 | | xlWK1ALL | 31 | Lotus 1-2-3 format | *.wk1 | 58 | | xlWK1FMT | 30 | Lotus 1-2-3 format | *.wk1 | 59 | | xlWK3 | 15 | Lotus 1-2-3 format | *.wk3 | 60 | | xlWK3FM3 | 32 | Lotus 1-2-3 format | *.wk3 | 61 | | xlWK4 | 38 | Lotus 1-2-3 format | *.wk4 | 62 | | xlWKS | 4 | Lotus 1-2-3 format | *.wks | 63 | | xlWorkbookDefault | 51 | Workbook default | *.xlsx | 64 | | xlWorkbookNormal | -4143 | Workbook normal | *.xls | 65 | | xlWorks2FarEast | 28 | Microsoft Works 2.0 far east format | *.wks | 66 | | xlWQ1 | 34 | Quattro Pro format | *.wq1 | 67 | | xlXMLSpreadsheet | 46 | XML Spreadsheet | *.xml | 68 | 69 | **Note:** For Automation Anywhere separate the parameters with space. 70 | **Note:** If any input has space surround it with quotations. 71 | 72 | **MIT License** 73 | **Copyright (c) 2019 Khaled Mostafa** -------------------------------------------------------------------------------- /Excel Operations/Excel To CSV/ExcelToCsv.vbs: -------------------------------------------------------------------------------- 1 | ExcelFile = Wscript.Arguments(0) 2 | CsvFile = Wscript.Arguments(1) 3 | SheetName = Wscript.Arguments(2) 4 | Set objExcel = CreateObject("Excel.application") 5 | objExcel.application.visible=false 6 | objExcel.application.displayalerts=false 7 | set objExcelBook = objExcel.Workbooks.Open(ExcelFile) 8 | objExcel.Sheets(SheetName).Select 9 | objExcelBook.SaveAs CsvFile, 23 10 | objExcel.Application.Quit 11 | objExcel.Quit -------------------------------------------------------------------------------- /Excel Operations/Excel To CSV/README.md: -------------------------------------------------------------------------------- 1 | **Input1 InputFile (String):** Full file path with extension as a parameter. 2 | **Input2 SheetName (String):** Sheet Name. 3 | **Input3 OutputFile (String):** Full file path with or without as a parameter. 4 | **Input4 Extension (String):** N/A. 5 | 6 | **Example:** `"C:\Users\Khaled\Desktop\Book1.xlsx" "Sheet1" "C:\Users\Khaled\Desktop\Book3"` 7 | 8 | **Note:** For Automation Anywhere separate the parameters with space. 9 | **Note:** If any input has space surround it with quotations. 10 | 11 | **MIT License** 12 | **Copyright (c) 2019 Khaled Mostafa** 13 | -------------------------------------------------------------------------------- /Excel Operations/Is Row Empty/README.md: -------------------------------------------------------------------------------- 1 | **Input1 FilePath (String):** Full file path with extension as a parameter. 2 | **Input2 SheetName (String):** Sheet Name. 3 | **Input3 RowNumber (String):** Row Number. 4 | **Output Boolean (String):** 0 or 1. 5 | 6 | **Example:** `"C:\Users\Khaled\Desktop\Book1.xlsx" "Sheet1" "5"` 7 | 8 | **Note:** For Automation Anywhere separate the parameters with space. 9 | **Note:** If any input has space surround it with quotations. 10 | 11 | **MIT License** 12 | **Copyright (c) 2019 Khaled Mostafa** -------------------------------------------------------------------------------- /Excel Operations/Is Row Empty/isRowEmpty.vbs: -------------------------------------------------------------------------------- 1 | Set appXL = CreateObject("Excel.application") 2 | appXL.Application.WorkBooks.Open(WScript.Arguments.Item(0)) 3 | appXL.Application.Visible = True 4 | Set excelSheet = appXL.Worksheets(WScript.Arguments.Item(1)) 5 | result = 0 6 | If appXL.CountA(WScript.Arguments.Item(2)) = 0 Then 7 | result = 1 8 | End If 9 | appXL.Quit 10 | WScript.StdOut.Write(result) 11 | WScript.Quit 12 | -------------------------------------------------------------------------------- /Files Operations/Check File Accessed Date Between Range Date/CheckFileAccessedDateBetweenRangeDate.vbs: -------------------------------------------------------------------------------- 1 | Dim Fso, FileObj, FilePath, StartDate, EndDate, FileDate, Result 2 | Set Fso = CreateObject("Scripting.FileSystemObject") 3 | FilePath = WScript.Arguments.Item(0) 4 | StartDate = WScript.Arguments.Item(1) 5 | EndDate = WScript.Arguments.Item(2) 6 | If (Fso.FileExists(FilePath)) Then 7 | Set FileObj = Fso.GetFile(FilePath) 8 | FileDate = FormatDateTime(FileObj.DateCreated,2) 9 | If (FileDate >= StartDate AND FileDate <= EndDate) Then 10 | Result = 1 11 | Else 12 | Result = 0 13 | End If 14 | Else 'File Doesn't Exit. 15 | Result = -1 16 | End If 17 | WScript.StdOut.Write(Result) 18 | WScript.Quit 19 | -------------------------------------------------------------------------------- /Files Operations/Check File Accessed Date Between Range Date/README.md: -------------------------------------------------------------------------------- 1 | **Input1 FilePath (String):** Full file path with extension as a parameter. 2 | **Input2 StartDate (String):** The start date. 3 | **Input3 EndDate (String):** The end date. 4 | **Output Boolean (String):** `0 = False , 1 = Ture , -1 = FileNotFound` 5 | 6 | **Example:** `"C:\Users\Khaled\Desktop\Test1.xlsx" "01/04/2019" "30/04/2019"` 7 | 8 | **Important Note:** The date format depends on date format, you can change from region settings. 9 | 10 | **Note:** For Automation Anywhere separate the parameters with space. 11 | **Note:** If any input has space surround it with quotations. 12 | 13 | **MIT License** 14 | **Copyright (c) 2019 Khaled Mostafa** 15 | -------------------------------------------------------------------------------- /Files Operations/Check File Created Date Between Range Date/CheckFileCreatedDateBetweenRangeDate.vbs: -------------------------------------------------------------------------------- 1 | Dim Fso, FileObj, FilePath, StartDate, EndDate, FileDate, Result 2 | Set Fso = CreateObject("Scripting.FileSystemObject") 3 | FilePath = WScript.Arguments.Item(0) 4 | StartDate = WScript.Arguments.Item(1) 5 | EndDate = WScript.Arguments.Item(2) 6 | If (Fso.FileExists(FilePath)) Then 7 | Set FileObj = Fso.GetFile(FilePath) 8 | FileDate = FormatDateTime(FileObj.DateCreated,2) 9 | If (FileDate >= StartDate AND FileDate <= EndDate) Then 10 | Result = 1 11 | Else 12 | Result = 0 13 | End If 14 | Else 'File Doesn't Exit. 15 | Result = -1 16 | End If 17 | WScript.StdOut.Write(Result) 18 | WScript.Quit 19 | -------------------------------------------------------------------------------- /Files Operations/Check File Created Date Between Range Date/README.md: -------------------------------------------------------------------------------- 1 | **Input1 FilePath (String):** Full file path with extension as a parameter. 2 | **Input2 StartDate (String):** The start date. 3 | **Input3 EndDate (String):** The end date. 4 | **Output Boolean (String):** `0 = False , 1 = Ture , -1 = FileNotFound` 5 | 6 | **Example:** `"C:\Users\Khaled\Desktop\Test1.xlsx" "01/04/2019" "30/04/2019"` 7 | 8 | **Important Note:** The date format depends on date format, you can change from region settings. 9 | 10 | **Note:** For Automation Anywhere separate the parameters with space. 11 | **Note:** If any input has space surround it with quotations. 12 | 13 | **MIT License** 14 | **Copyright (c) 2019 Khaled Mostafa** 15 | -------------------------------------------------------------------------------- /Files Operations/Check File Modified Date Between Range Date/CheckFileModifiedDateBetweenRangeDate.vbs: -------------------------------------------------------------------------------- 1 | Dim Fso, FileObj, FilePath, StartDate, EndDate, FileDate, Result 2 | Set Fso = CreateObject("Scripting.FileSystemObject") 3 | FilePath = WScript.Arguments.Item(0) 4 | StartDate = WScript.Arguments.Item(1) 5 | EndDate = WScript.Arguments.Item(2) 6 | If (Fso.FileExists(FilePath)) Then 7 | Set FileObj = Fso.GetFile(FilePath) 8 | FileDate = FormatDateTime(FileObj.DatelastModified,2) 9 | If (FileDate >= StartDate AND FileDate <= EndDate) Then 10 | Result = 1 11 | Else 12 | Result = 0 13 | End If 14 | Else 'File Doesn't Exit. 15 | Result = -1 16 | End If 17 | WScript.StdOut.Write(Result) 18 | WScript.Quit 19 | -------------------------------------------------------------------------------- /Files Operations/Check File Modified Date Between Range Date/README.md: -------------------------------------------------------------------------------- 1 | **Input1 FilePath (String):** Full file path with extension as a parameter. 2 | **Input2 StartDate (String):** The start date. 3 | **Input3 EndDate (String):** The end date. 4 | **Output Boolean (String):** `0 = False , 1 = Ture , -1 = FileNotFound` 5 | 6 | **Example:** `"C:\Users\Khaled\Desktop\Test1.xlsx" "01/04/2019" "30/04/2019"` 7 | 8 | **Important Note:** The date format depends on date format, you can change from region settings. 9 | 10 | **Note:** For Automation Anywhere separate the parameters with space. 11 | **Note:** If any input has space surround it with quotations. 12 | 13 | **MIT License** 14 | **Copyright (c) 2019 Khaled Mostafa** 15 | -------------------------------------------------------------------------------- /Files Operations/Get All Files In Folder/GetAllFilesInFolder.vbs: -------------------------------------------------------------------------------- 1 | 'Developed and Edited by Khaled Mostafa 2 | ' 3 | '####### Usage ####### 4 | 'Input (String): Full folder path as a parameter and without quotations 5 | 'Output (String): Listing all the files in one string. 6 | 'Example: Input: C:\Users\Khaled\Desktop\ 7 | ' 8 | '####### License ####### 9 | 'MIT License 10 | 'Copyright (c) 2019 Khaled Mostafa 11 | 'For More info: https://github.com/KhaledMostafaME 12 | 13 | Set objFSO = CreateObject("Scripting.FileSystemObject") 14 | objStartFolder = WScript.Arguments.Item(0) 15 | Set objFolder = objFSO.GetFolder(objStartFolder) 16 | Dim Files 17 | Set colFiles = objFolder.Files 18 | For Each objFile in colFiles 19 | Files = Files + objFile.Name + " " 20 | Next 21 | WScript.StdOut.Write(Files) 22 | WScript.Quit 23 | -------------------------------------------------------------------------------- /Files Operations/Get All Files In Folder/README.md: -------------------------------------------------------------------------------- 1 | **Input (String):** Full file path with extension. 2 | **Output (String):** Listing all the files in one string. 3 | 4 | **Example:** `"C:\Users\Khaled\Desktop"` 5 | 6 | **Note:** For Automation Anywhere separate the parameters with space. 7 | **Note:** If any input has space surround it with quotations. 8 | 9 | **MIT License** 10 | **Copyright (c) 2019 Khaled Mostafa** -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Khaled Mostafa 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Numbers Operations/Liner Calculator/LinerCalculator.vbs: -------------------------------------------------------------------------------- 1 | ' Turn on error Handling 2 | On Error Resume Next 3 | 4 | Dim ii, sOperator, strExpr, y 5 | strExpr = WScript.Arguments.Item(0) 6 | ' insert spaces around all operators 7 | strExpr = Replace(strExpr,"=","") 8 | For Each sOperator in Array("+","-","*","/","%") 9 | strExpr = Trim( Replace( strExpr, sOperator, Space(1) & sOperator & Space(1))) 10 | Next 11 | ' replace all multi spaces with a single space 12 | Do While Instr( strExpr, Space(2)) 13 | strExpr = Trim( Replace( strExpr, Space(2), Space(1))) 14 | Loop 15 | Result = Eval(strExpr) 16 | 17 | ' Error Handler 18 | If Err.Number <> 0 Then 19 | WScript.StdOut.Write("Error: " & Err.Description) 20 | Err.Clear 21 | WScript.Quit 22 | Else 23 | WScript.StdOut.Write(Result) 24 | End If 25 | WScript.Quit 26 | -------------------------------------------------------------------------------- /Numbers Operations/Liner Calculator/README.md: -------------------------------------------------------------------------------- 1 | **Input Liner Math Operation(String):** Math operation surrounded by quotations, or as a viarble. 2 | **Output Result (String):** Calculation result. 3 | 4 | 5 | **Accepted operations:** `"+","-","*","/","%"` 6 | **Example:** `"1 + 5"` 7 | 8 | 9 | **MIT License** 10 | **Copyright (c) 2019 Khaled Mostafa** -------------------------------------------------------------------------------- /Numbers Operations/Number To Double/NumberToDouble.vbs: -------------------------------------------------------------------------------- 1 | Dim vIn, vPoints, vOut 2 | vIn = Wscript.Arguments(0) 3 | vPoints = Wscript.Arguments(1) 4 | vOut = FormatNumber(vIn,vPoints,,,0) 5 | WScript.StdOut.Write(vOut) 6 | -------------------------------------------------------------------------------- /Numbers Operations/Number To Double/README.md: -------------------------------------------------------------------------------- 1 | **Input Number (String):** Input Number. 2 | **Input DecimalPlaces (String):** Number of Decimal Places. 3 | **Output Result (String):** Conversation result. 4 | 5 | **Example:** 6 | **Input:** `12343 2` 7 | **Output:** `12343.00` 8 | 9 | **For More Info:** https://www.w3schools.com/asp/func_formatnumber.asp 10 | 11 | **MIT License** 12 | **Copyright (c) 2019 Khaled Mostafa** -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Automation Anywhere VBS Scripts 2 | This repo contains some VBS that will help you to prefome some action on Automation Anywhere using Run Script command. -------------------------------------------------------------------------------- /Scripts/CheckFileModifiedDate.vbs: -------------------------------------------------------------------------------- 1 | 'Developed and Edited by Khaled Mostafa 2 | '####### Usage ####### 3 | 'Pass full file path with extension as a parameter 4 | 'For More info: https://github.com/KhaledMostafaME 5 | 6 | Dim Fso, Msg, FileObj, FilePath 7 | Set Fso = CreateObject("Scripting.FileSystemObject") 'Creates "FileSystemObject" Object. 8 | FilePath = WScript.Arguments.Item(0) 'Getting parameter 9 | If (Fso.FileExists(FilePath)) Then 'Checks Whether File Exits At The Specified Path 10 | Set FileObj = Fso.GetFile(FilePath) 'Returns "File" Object 11 | Msg = FileObj.DateLastModified 12 | Else 'File Doesn't Exit. 13 | Msg = "File : " & FilePath & " Doesn't Exist." 14 | End If 15 | WScript.StdOut.WriteLine Msg 'return the msg -------------------------------------------------------------------------------- /Scripts/CreateExcelSheetAsXlsx.vbs: -------------------------------------------------------------------------------- 1 | 'Developed and Edited by Khaled Mostafa 2 | '####### Usage ####### 3 | 'Pass full file path with extension as a parameter 4 | 'For More info: https://github.com/KhaledMostafaME 5 | 6 | strFileName = WScript.Arguments.Item(0) 7 | Set objExcel = CreateObject("Excel.Application") 8 | Set objWorkbook = objExcel.Workbooks.Add() 9 | objWorkbook.SaveAs(strFileName) 10 | objExcel.Quit -------------------------------------------------------------------------------- /Scripts/SplitTiffImages.vbs: -------------------------------------------------------------------------------- 1 | 'Developed and Edited by Khaled Mostafa 2 | '####### Usage ####### 3 | 'Parameter 1: Pass full TIFF file path with extension 4 | 'Parameter 2: Pass full path of save location 5 | 'Parameter 3: Pass extension type of the output image with dot. ie -> .jpg .png .jpeg .tiff .tif 6 | 'For More info: https://github.com/KhaledMostafaME 7 | 8 | Dim Img, myPage, v, lp 9 | Set Img = WScript.CreateObject("WIA.ImageFile") 10 | 11 | Img.LoadFile WScript.Arguments.Item(0) 12 | 13 | For lp = 1 To Img.FrameCount 14 | Img.ActiveFrame = lp 15 | Set v = Img.ARGBData 16 | Set myPage = v.ImageFile(Img.Width, Img.Height) 17 | myPage.SaveFile WScript.Arguments.Item(1) & "\img_" & lp & WScript.Arguments.Item(2) 18 | Next -------------------------------------------------------------------------------- /String Operations/Count Character Occurrences/CountCharacterOccurrences.vbs: -------------------------------------------------------------------------------- 1 | inputString = Wscript.Arguments(0) 2 | character = Wscript.Arguments(1) 3 | Count = len(inputString) - len(replace(inputString, character, "")) 4 | Result = Count/len(character) 5 | WScript.StdOut.Write(Result) 6 | WScript.Quit 7 | -------------------------------------------------------------------------------- /String Operations/Count Character Occurrences/README.md: -------------------------------------------------------------------------------- 1 | **Input1 Source (String):** Input String 2 | **Input2 Character (String):** The character to count. 3 | **Output Count (String):** N/A. 4 | 5 | **Example:** `"a/b/c/d or a/b" "/"` 6 | 7 | **Note:** For Automation Anywhere separate the parameters with space. 8 | **Note:** If any input has space surround it with quotations. 9 | 10 | **MIT License** 11 | **Copyright (c) 2019 Khaled Mostafa** 12 | -------------------------------------------------------------------------------- /_template.vbs: -------------------------------------------------------------------------------- 1 | ' Turn on error Handling 2 | On Error Resume Next 3 | 4 | 5 | 6 | ' Error Handler 7 | If Err.Number <> 0 Then 8 | WScript.StdOut.Write("Error: " & Err.Description) 9 | Err.Clear 10 | WScript.Quit 11 | Else 12 | WScript.StdOut.Write("Success") 13 | End If 14 | WScript.Quit 15 | --------------------------------------------------------------------------------