{"id":13942492,"url":"https://github.com/ArielLomoctos/vba-projects","last_synced_at":"2025-07-20T06:31:19.249Z","repository":{"id":131098421,"uuid":"128203738","full_name":"ArielLomoctos/vba-projects","owner":"ArielLomoctos","description":"This repository contains all projects, coding standards, boilerplate, and best practices. This is intended to share my experience and expertise so everyone can fork or download everything from this repository even without permission. Happy Coding!","archived":false,"fork":false,"pushed_at":"2018-04-05T14:14:31.000Z","size":31,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-27T12:36:45.733Z","etag":null,"topics":["best-practices","coding-standards","freelance-work","vba","vba-automation","vba-forms","vba-sapscripting","vba-snippets","vba-webscraping"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArielLomoctos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-04-05T12:34:55.000Z","updated_at":"2024-11-06T05:57:42.000Z","dependencies_parsed_at":"2023-04-04T09:57:27.893Z","dependency_job_id":null,"html_url":"https://github.com/ArielLomoctos/vba-projects","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ArielLomoctos/vba-projects","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArielLomoctos%2Fvba-projects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArielLomoctos%2Fvba-projects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArielLomoctos%2Fvba-projects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArielLomoctos%2Fvba-projects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArielLomoctos","download_url":"https://codeload.github.com/ArielLomoctos/vba-projects/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArielLomoctos%2Fvba-projects/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266076350,"owners_count":23872741,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["best-practices","coding-standards","freelance-work","vba","vba-automation","vba-forms","vba-sapscripting","vba-snippets","vba-webscraping"],"created_at":"2024-08-08T02:01:54.064Z","updated_at":"2025-07-20T06:31:19.002Z","avatar_url":"https://github.com/ArielLomoctos.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"# Visual-Basic-For-Application-Projects\nThis repository contains all projects, coding standards, boilerplate, and best practices. This is intended to share my experience and expertise so everyone can fork or download everything in this repository even without permission.\n\n#### `VBA CODING STANDARDS AND BEST PRACTICES`\n- Enable `Option Explicit`\n  - This Forces explicit declaration of all variables in a file, or allows implicit declarations of variables.\n- Use `Title blocks for each Macro`\n  - This title blocks will give you information about the module what it does and how it will be called.\n```\n        PROGRAM:         UpdateCustomerCur\n        DESCRIPTION:     This is to update the list of customer currency in the database\n        CALL:            Call thru Macro UpdateCustomerCur\n```\n- Get Advantage of `Modular Programming` Technique\n  - Modular programming is a software design technique that emphasizes seperating the functionality of a program into dependent, interchangeable modules, such that each contains everything necessary to execute only one aspect of the desired functionality.\n  - Categorize and divide your code based from what it does and create one module for similar task. Follow Modular Programming technique due to its advantage when refactoring and scaling your code. Also, it will give you less headache when you're debugging your code, easy to understand, and really helpful for big and complex projects.\n\n- Declaring `Constants and Variables`\n  - The scope of a variable in Excel VBA determines where that variable may be used. You determine the `scope of a variable` when you declare it. There are three scoping levels: procedure level, module level, and public module level.\n  - Make use the advantage of declaring variables based from scope (i.e. Local, Module, Public)\n  - `Constants` are coded in ALL_UPPER_CASE with words seperated by underscores.\n```\n    Global Const WDGT_STATUS_OK = 0\n    Global Const WDGT_STATUS_BUSY = 1\n    Global Const WDGT_STATUS_FAIL = 2\n    Global Const WDGT_STATUS_OFF = 3\n    Global Const WDGT_STATUS_START = 4\n    Global Const WDGT_STATUS_STOP = 5\n```\n- Naming Convention for SubProcedures and Functions \u003e\u003e\u003e `VERB.NOUN.ADJECTIVE`\n```\n    Sub UpdateCustomerCur()\n      'Code goes here\n    End Sub\n```\n- Use `HungarianNotation` for Variables, Constants, SubProcedures and Functions\n  - Hungarian notation is an identifier naming convention in computer programming, in which the name of a variable or function indicates its intention or kind, and in some dialects its type. The original Hungarian Notation uses intention or kind in its naming convention and is sometimes called Apps Hungarian as it became popular in the Microsoft Apps division in the development of Word, Excel and other apps. As the Microsoft Windows division adopted the naming convention, they used the actual data type for naming, and this convention became widely spread through the Windows API; this is sometimes called Systems Hungarian notation.\n\n```\n      Dim strMyName As String\n      Dim intMyNumber As Integer\n```\n\n```\nDECLARING VARIABLES\n        VARIABLE       TAG             NOTES\n        BOOLEAN        bln             blnFound\n        BYTE           byt             bytRasterData\n        CURRENCY       cur             curRevenue\n        DATE (Time)    dat             datStart\n        DOUBLE         dbl             dblTolerance\n        ENUM           enm             enmColours\n        INTEGERS       int             intQuantity\n        LONG           lng             lngDistance\n        SINGLE         sng             sngAverage\n        STRING         str             strCustName\n        USERDEFINED    udt             udtEmployee\n        Variant        var             varCheckSum\n\nOTHER PREFIXES\n        cbo ComboBox\n        chk CheckBox\n        cmd CommandButton\n        frm Form\n        img Image\n        lbl Lable\n        lst ListBox\n        rpt Report\n        shp Shape\n        txt TextBox\n        tbl Table\n        ole OLE Control\n        pic Picture\n        pnl Panel\n        qry Query\n\n        Db Database\n        ws Workspace\n        rs Recordset\n        xl Excel Object\n        wd Word Object\n```\n***\n# Data-Evidence-Collector\nA Microsoft Excel Application using Visual Basic for Application (VBA) programming to web scrape documents and extract supporting documents. Note: `This project won't run without a \"private\" application installed/accessed`. However, web scraping techniques and codes used in this project could serve as reference for other developers.\n\n![Data-Evidence-Collector-Screenshot](https://github.com/ArielLomoctos/Visual-Basic-For-Application-Projects/blob/master/DataEvidenceCollector-Screenshot.JPG)\n`Click to Download:` https://drive.google.com/file/d/1DI0cC_ip_8U7BKuoLiNZoqZ2hYzUZMTr/view\n\n#### `OPEN INTERNET EXPLORER INSTANCE`\n\nNote: Setup Library Reference: Ctrl+F11 \u003e Tools \u003e References \u003e Find/Tick: Microsoft HTML Object Library, Microsoft Internet Controls\n\n\t'Open Internet Explorer instance and ie as visible\n\t\n\tDim IE as InternetExplorerMedium\n\tSet IE = New InternetExplorerMedium\n\tIE.navigate \"www.google.com\"\n\tIE.Visible = True\n\n\t'Loop Until IE.Loading Readystate_Complete\n\t\n\tDo Until IE.readyState = READYSTATE_COMPLETE\n\t\tDoEvents\n\tLoop\n\t\n#### `CALL, ACTIVATE, MANIPULATE HTML-TAG-ELEMENTS`\n\n\t'User Input\n\tIE.document.getElementById(\"MainContent_txtRequestNumber\").Value = \"Text\"\n\n\t'Tick documents: Boolean (True or False)\n\tIE.document.getElementById(\"MainContent_cbxGetInbox\").Checked = False\n\n\t'Click buttons:\n\tIE.document.getElementById(\"MainContent_btnSearch\").Click\n\n\t'Wait / Run after some time\n\tApplication.Wait (Now + TimeValue(\"00:00:05\"))\n\n\t'Get value within html grid/table \u003ctd\u003e\n\tIE.document.getElementById(\"MainContent_grdSearch\").getElementsByClassName(\"gridDataRow\")(0).getElementsByTagName(\"td\")(4).innerText\n\n#### `EXTRACT DOCUMENTS BASED FROM URL`\n\n\tPrivate Declare Function URLDownloadToFileA Lib \"urlmon\" (ByVal pCaller As Long, _\n\tByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, _\n\tByVal lpfnCB As Long) As Long\n\n\tPrivate Function downloadfile(URL As String, LocalFilename As String) As Boolean\n\t\t\tDim lngRetVal As Long\n\t\t\tlngRetVal = URLDownloadToFileA(0, URL, LocalFilename, 0, 0)\n\t\t\tIf lngRetVal = 0 Then downloadfile = True\n\tEnd Function\n\n\tSub DownloadFileWithURLlink()\n\t\t'URLlink, Filename\n\t\tdownloadfile www.google.com/1fajf-fhd241d-1345f.docx, \"wordfilename.docx\"\n\tEnd Sub\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FArielLomoctos%2Fvba-projects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FArielLomoctos%2Fvba-projects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FArielLomoctos%2Fvba-projects/lists"}