Skip to content

Instantly share code, notes, and snippets.

View brucemcpherson's full-sized avatar

bruce mcpherson brucemcpherson

View GitHub Profile
@brucemcpherson
brucemcpherson / scriptDbCom.xml
Last active April 11, 2021 15:22
gistthat manifest for scriptdbcom - VBA scriptDB API
<gistThat info="this is a manifest for gistThat VBA code distribution - see ramblings.mcpher.com for details">
<manifest description="cDataset and associated classes and modules" contact="bruce@mcpher.com">
<gists>
<item1 gistid="3414216" version="" filename="cCell.cls" module="cCell" type="class" />
<item2 gistid="3414216" version="" filename="cDataSet.cls" module="cDataSet" type="class" />
<item3 gistid="3414216" version="" filename="cDataSets.cls" module="cDataSets" type="class" />
<item4 gistid="3414216" version="" filename="cDataColumn.cls" module="cDataColumn" type="class" />
<item5 gistid="3414216" version="" filename="cDataRow.cls" module="cDataRow" type="class" />
<item6 gistid="3414216" version="" filename="cHeadingRow.cls" module="cHeadingRow" type="class" />
<item7 gistid="3414346" version="" filename="" module="usefulStuff" type="module" />
Option Explicit
'v1.1 - 5116003
Private Function testTableToHtml()
Dim content As String, fn As String, _
sheetName As String, maxrows As Long, styles As String, _
outputType As String
' an example of how to use these
' you could make a form or dialog to set these up
' name of worksheet containing the data
sheetName = "sankey"
@brucemcpherson
brucemcpherson / usefulChartStuff.vba
Last active April 11, 2021 15:21
useful chart stuff - for more info see http://ramblings.mcpher.com
Option Explicit
' v2.01 -
Public Function createSurfaceChart(ds As cDataSet, n As String, _
Optional xlt As Long = xlSurface, _
Optional targetLegends As Long = 0, _
Optional colorRampName As Variant = "heatmap", _
Optional showLegend As Boolean = False, _
Optional brighten As Double = 1, _
Optional showAxis As Boolean = True) As Chart
@brucemcpherson
brucemcpherson / cBrowser.cls
Last active April 11, 2021 15:21
cBrowser - web service access
'gistThat@mcpher.com :do not modify this line - see ramblings.mcpher.com for details: updated on 11/22/2013 11:15:19 AM : from manifest:7471153 gist https://gist.github.com/brucemcpherson/3423912/raw/cBrowser.cls
Option Explicit
' acknowledgement
' http://pastie.org/1192157 for basic authentication 'how to'
'for more about this
' http://ramblings.mcpher.com/Home/excelquirks/classeslink/data-manipulation-classes
'to contact me
' http://groups.google.com/group/excel-ramblings
'reuse of code
' http://ramblings.mcpher.com/Home/excelquirks/codeuse
@brucemcpherson
brucemcpherson / gistAddRefs.vba
Last active April 11, 2021 15:20
This will add references needed by gistThat bootstrap
'IMPORTANT - CHANGE gtExampleLoad() to include gtDoit() for each Gist you want to load
' bootstrap code to update VBA modules from gists
' all code is in this module - so no classes etc.
' latebinding is used to avoid need for any references
' can be found at https://gist.github.com/3403537
Option Explicit
' v2.02
' if you are using your own gists - change this
Const gistOwner = "brucemcpherson"
@brucemcpherson
brucemcpherson / gistThat_.vba
Last active April 11, 2021 15:03
Bootstrap for gistThat_ code distributor for VBA
'IMPORTANT - CHANGE gtExampleLoad() to include gtDoit() for each Gist you want to load
' bootstrap code to update VBA modules from gists
' all code is in this module - so no classes etc.
' latebinding is used to avoid need for any references
' can be found at https://gist.github.com/3403537
Option Explicit
' v2.04 - 3403537
' if you are using your own gists - change this
Const gistOwner = "brucemcpherson"
@brucemcpherson
brucemcpherson / dbAbstraction.vba
Last active April 5, 2021 19:27
demo for how to use a variety of database backends, enabled by a google apps script backend, directly from VBA. for details see http://ramblings.mcpher.com/Home/excelquirks/dbapps/dbvariety
Option Explicit
' this is how to use Google Apps Script dbabstration web app from Excel.
' version 0.2
' http://ramblings.mcpher.com/Home/excelquirks/dbabstraction
' http://ramblings.mcpher.com/Home/excelquirks/googleoauth2 for how to set up yor pc for oauth2
Public Sub demoDBAccess()
Dim data As cJobject
Dim siloId As String, places As cJobject, place As cJobject, result As cJobject, _
sheetId, driveFolder As String, fusionId As String
@brucemcpherson
brucemcpherson / UAMeasure.xml
Created November 14, 2013 17:47
gistThat manifest for UAMeasure - VBA / google analytics - http://ramblings.mcpher.com/Home/excelquirks/universalanalytics
<?xml version="1.0" encoding="UTF-8"?>
<gistThat info="this is a manifest for gistThat VBA code distribution - see ramblings.mcpher.com for details">
<manifest description="UAMeasure Protocol" contact="bruce@mcpher.com">
<gists>
<item1 gistid="6937529" version="" filename="usefulEncrypt.vba" module="usefulEncrypt" type="module" />
<item2 gistid="7453196" version="" filename="UAMeasure.vba" module="UAMeasure" type="module" />
<item3 gistid="7453152" version="" filename="cUAMeasure.cls" module="cUAMeasure" type="class" />
<item4 gistid="3423912" version="" filename="cBrowser.cls" module="cBrowser" type="class" />
<item5 gistid="3414346" version="" filename="" module="usefulStuff" type="module" />
<item6 gistid="5102369" version="" filename="cStringChunker.cls" module="cStringChunker" type="class" />
@brucemcpherson
brucemcpherson / cJobject.cls
Last active February 23, 2021 11:27
cJobject class for VBA - converts jSon/excel
'gistThat@mcpher.com :do not modify this line - see ramblings.mcpher.com for details: updated on 8/9/2014 3:09:42 PM : from manifest:3414394 gist https://gist.github.com/brucemcpherson/3414365/raw
' this is used for object serliazation. Its just basic JSON with only string data types catered for
Option Explicit
' v2.19 3414365
'for more about this
' http://ramblings.mcpher.com/Home/excelquirks/classeslink/data-manipulation-classes
'to contact me
' http://groups.google.com/group/excel-ramblings
'reuse of code
' http://ramblings.mcpher.com/Home/excelquirks/codeuse
function doPost(e) {
// some defaults for standalone testing
e = e || {postData:{contents:"<a>a</a>"}};
e.queryString = e.queryString || "convert=xmltojson" ;
var type = e.queryString.toLowerCase().split("=");
// convert xml to json
var results = {status:"bad", error:"no errors"};
try {