Use of symbol # (hash) in VBA Macro

The type-declaration character for Double is the number sign (#). Also called HASH Other type declaration characters are: Integer % Long & Currency @ Single ! Double # String $ Don’t understand the significance of # here. It implies that when the expression is evaluated, the number in front of the type declaration character is … Read more

Excel VBA Load worksheet in Function

That’s right, execution of user-defined functions has certain limitations. There is few tricks to do what you want within UDF and not to violate an order. 1. Get another instance of Excel.Application via late binding, open workbook with it, perform all the necessary calculations by referring to the instance. It’s critical to refer exactly to … Read more

Controlling IE11 “Do you want to Open/Save” dialogue window buttons in VBA

It’s solved finally… Option Explicit Public Declare Sub Sleep Lib “kernel32” (ByVal dwMilliseconds As Long) Private Declare Function FindWindowEx Lib “user32” Alias “FindWindowExA” _ (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, _ ByVal lpsz2 As String) As Long Public Sub AddReference() ThisWorkbook.VBProject.References.AddFromFile “C:\Windows\SysWOW64\UIAutomationCore.dll” End Sub ‘after my original code as … Read more

Use autofilter on more than 2 criteria

Use this one instead: .AutoFilter Field:=1, Criteria1:=Array(“HP Compaq 6000”, “HP Compaq 8000”, _ “HP Compaq 8200”, “HP Compaq 8200 Elite”, _ “HP Compaq dc5800”, “HP Compaq dc7900”, _ “HP Compaq Elite 8300 SFF”, “HP Compaq Pro 8300 SFF”), _ Operator:=xlFilterValues

VBA : save a file with UTF-8 without BOM

In the best of all possible worlds the Related list would contain a reference to this question which I found as the first hit for “vbscript adodb.stream bom vbscript site:stackoverflow.com”. Based on the second strategy from boost’s answer: Option Explicit Const adSaveCreateNotExist = 1 Const adSaveCreateOverWrite = 2 Const adTypeBinary = 1 Const adTypeText = … Read more