This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//perf start | |
var lastCallName = ''; | |
function timePromise(name) { | |
var lastNameToEnd = lastCallName ? lastCallName : ''; | |
lastCallName = name; | |
return function (data) { | |
if (lastNameToEnd) console.timeEnd(lastNameToEnd); | |
console.time(name); | |
return data; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'--------------------------------------------------------------------------------------- | |
' Function: ClearDataWorksheet | |
'--------------------------------------------------------------------------------------- | |
' Purpose: clear worksheet content after header | |
' Param : Worksheet wksSheet reference to worksheet | |
' Remarks: e.g. usage: Call ClearDataWorksheet(ThisWorkbook.Worksheets(1)) | |
'--------------------------------------------------------------------------------------- | |
Public Function ClearDataWorksheet(ByRef wksSheet As Worksheet) | |
Dim lLastRow As Long | |
Dim lLastColumn As Long |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'modified from http://needtec.sakura.ne.jp/codeviewer/index.php?id=2 | |
Public Function UnescapeUTF8(ByVal StringToDecode As String) As String | |
Dim i As Long | |
Dim acode As Integer, sTmp As String | |
On Error Resume Next | |
If InStr(1, StringToDecode, "\") = 0 And InStr(1, StringToDecode, "%") = 0 Then | |
UnescapeUTF8 = StringToDecode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function GetDBNameFromConnString(ByVal connString As String) As String | |
Dim lcConnString As String | |
Dim endIndex As Integer | |
lcConnString = LCase(connString) | |
' if this is a Jet database, find the index of the "data source" setting | |
Dim startIndex As Integer | |
If InStr(1, lcConnString, "jet.oledb", vbTextCompare) > -1 Then | |
startIndex = InStr(1, lcConnString, "data source=", vbTextCompare) |