Skip to content

Instantly share code, notes, and snippets.

View vbamagician's full-sized avatar
🎯
Focusing

Kamal C. Bharakhda vbamagician

🎯
Focusing
View GitHub Profile
@vbamagician
vbamagician / Async.gs
Created August 14, 2022 17:06 — forked from sdesalas/Async.gs
Asynchronous execution for Google App Scripts (gas)
/*
* Async.gs
*
* Manages asyncronous execution via time-based triggers.
*
* Note that execution normally takes 30-60s due to scheduling of the trigger.
*
* @see https://developers.google.com/apps-script/reference/script/clock-trigger-builder.html
*/
@vbamagician
vbamagician / CShapeEvents.cls
Created May 7, 2020 14:02 — forked from sancarn/CShapeEvents.cls
Shape events in VBA
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "CShapeEvents"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Private old_selection As Object
@vbamagician
vbamagician / Pull-and-Sync-Data-Between-Google-Doc-Spreadsheet-and-MySQL.gs
Created September 7, 2018 16:30
You can pull data from MySQL database to Google doc spreadsheet auto with just click of a button or scheduled time. This is great use for retrieving data in spreadsheet format.
// MySQL to Google Spreadsheet By Pradeep Bheron
// Support and contact at pradeepbheron.com
function myMySQLFetchData() {
var conn = Jdbc.getConnection('jdbc:mysql://127.0.0.1:3306/employee_db', 'username', 'pass'); // Change it as per your database credentials
var stmt = conn.createStatement();
var start = new Date(); // Get script starting time
@vbamagician
vbamagician / VB SQL
Created April 19, 2018 17:22 — forked from radum/VB SQL
Query MS SQL Server With Excel VBA
' Before we can start you’ll need to add a reference to your VBA project:
' Microsoft ActiveX Data Objects x.x Library
Option Explicit
Private Conn As ADODB.Connection
Function ConnectToDB(Server As String, Database As String) As Boolean
Set Conn = New ADODB.Connection
On Error Resume Next