VB == #Command Line Compile to exe [Go To vbc.exe path then run] vbc.exe /t:exe /debug+ /optionstrict+ /out:\\SomePathandOutFile.exe \\SomePathandInFile.vb #Conversions Oct Conversion &O10 = 8 Hex Conversion &H10 = 16 #Run external program and wait Dim obj As Object: Set obj = CreateObject("Wscript.Shell"): obj.Run "cmd /C dir & pause", , True #Deskop Windows Re Tile Dim x As New Shell32.Shell: x.CascadeWindows: x.TileHorizontally: x.TileVertically: x.ToggleDesktop:x.ShutdownWindows #Formats format(now(),"\Quarter Q DDDD-DDD-DD-MMMM-MMM-MM-M-YYYY HH:MM:SS \Week WW")=Quarter 2 Monday-Mon-10-April-Apr-04-4-2017 09:46:23 Week 15 format(1234567.20,"#,###,.00")=1234.57 ' ## NB Use Chr(34) Not " when using in code API in VB Help ============== #General AddressOf procedurename ( causes the address of the procedure it precedes to be passed to an API procedure that expects a function pointer )  #Sleep Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long) IE Browser Via VBA ================== #Run Javascript in IE browser [Existing and Injected] Sub OpenBrowserAndRunInjectedJavaScript()  'Add Refs Internet Controls IEFrame.dll AND HTML Object Library mshtml.tlb  '-------------------------------------------------------------------------  Dim ie As New InternetExplorer, doc As HTMLDocument: ie.Visible = True: ie.Navigate2 "www.bbc.co.uk"  Do While ie.readyState <> READYSTATE_COMPLETE: DoEvents: Loop: Set doc = ie.document  doc.parentWindow.execScript "alert('OK');", "Javascript"  'Run Known Function In a Frame  '-----------------------------  ie.Navigate2 "https://www.w3schools.com/js/tryit.asp?filename=tryjs_whereto_external": Do While ie.readyState <> READYSTATE_COMPLETE: DoEvents: Loop: Set doc = ie.document  doc.frames("iframeResult").execScript "myFunction();", "Javascript": Stop  ie.Quit End Sub UI in VBA [nameOfYourChoice] ========= #Add Ref# C:\windows\system32\UIAutomationCore.dll #Create Automation Object# Dim [UIObj] as New CUIAutomation #Get Root Element# Dim [Dsktp] As IUIAutomationElement : Set [Dsktp] = [UIObj].GetRootElement #Get All Children In Array# Dim [DtChildNodes] As IUIAutomationElementArray : Set [DtChildNodes] = [Dsktp].FindAll(TreeScope_Children, Auto.CreateTrueCondition) #Get a Value Procedure (Text and Number) and Use# Dim [VAL] As IUIAutomationValuePattern : Set [VAL] = [DialogNodes].GetElement([n]).GetCurrentPattern(UIA_PatternIds.UIA_ValuePatternId) :[VAL].SetValue [MyFilename] #Get an Invoke Procedure and Use# Dim [INV] As IUIAutomationInvokePattern : Set [INV] = [obSubMenuList].GetElement([n]).GetCurrentPattern(UIA_PatternIds.UIA_InvokePatternId) : [INV].Invoke #Get an Expand/Collapse Procedure and Use# Dim [EXP] As IUIAutomationExpandCollapsePattern : Set [EXP] = [obMenuList].GetElement([n]).GetCurrentPattern(UIA_PatternIds.UIA_ExpandCollapsePatternId):[EXP].Expand #Customised FindAll (e.g UIA_LocalizedControlTypePropertyId = "menu item")# Dim [SubMenuList] As IUIAutomationElementArray Set [SubMenuList] = [DtChildNodes].GetElement([n]).FindAll(TreeScope_Subtree, Auto.CreatePropertyCondition(UIA_PropertyIds.UIA_LocalizedControlTypePropertyId, "menu item")) SAP in VB ========= #Grab session already opened Set SapApplication = SapGuiAuto.GetScriptingEngine Set Connection = SapApplication.OpenConnection("Your Systems Name", True) Set sessionN = Connection.Children(0) #Find Element sessionN.findById("ID").SelectAfunction #General Functions .Maximize .pressToolbarButton "&MB_VARIANT" .pressToolbarContextButton "&MB_EXPORT" .SelectContextMenuItem "&PC" .SetFocus .Select .SendVkey #Check Box Functions .Selected=True #List Box Functions .Key="n" #Text Box Functions .text #Button Functions .press #ShellGrid Functions .visiblerowcount .getcellvalue(n, "COLUMN NAME") .currentCellRow = n .selectedRows = "" & n & "" .doubleClickCurrentCell .ClickCurrentCell CMD === & (Runs multiple commands eg "DIR & PAUSE") Common Classes ============== CreateObject("").. ================== Outlook.Application Excel.Application Word.Application Powerpoint.Application Access.Application Wscript.Shell Dim X as New ... ================ InternetExplorer (Turn Off Enable Protected Mode if dissconnection!) Javascript ========== #Run Javascript that exists in a named frame document.iframeResult.window.myFunction() [runs myFunction from browser console when its in an iframe called "iframeResult"] #Get Recordset from MSAccess as Javascript Array For File "C:\\FolderA\\FolderB\\..\\...DatabaseName.accdb" And PASSWORD='password' [IE Only]  function ReadAccess(sql) {var adoConn = new ActiveXObject("ADODB.Connection");var adoRS = new ActiveXObject("ADODB.Recordset");    try {adoConn.Open("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='C:\\FolderA\\FolderB..\\..\\DatabaseName.accdb';Jet OLEDB:Database Password='password'");}  catch(err) {alert(err + "Login Error");} adoRS.Open(sql, adoConn, 1, 3); var fc = adoRS.Fields.Count; ds=[]; while (adoRS.EOF==false)    {rs=[]; for (i=0;i