Category: Visual Basic
-
Excel VBA – Can’t find library or project.
Here is the solution to the puzzling error “Can’t find library or project.” after opening a macro enabled WorkBook. The issue isn’t references or anything like that. Close the WorkBook, don’t need to save changes, and then open the WorkBook up in Safe Mode by holding down the Ctrl key at the same time. This…
-
Export Android contacts contacts2.db to vCard vcf on Windows
The other day I need to restore some contacts on an Android phone, I had Titanium Backup files, though restoring the contacts through there didn’t seem to work. I searched for a solution but there wasn’t really anything for Windows to restore the contacts so I developed my own VBA script. I will assume you already…
-
VBA/VBS check if printer is installed
Here is a quick code snippet to determine if a printer is installed on a Microsoft Windows system;
-
VB functions for determining red/black numbers on roulette wheel
Here are two simple functions for calculating if a number falls on red or black on a roulette wheel, for the perfectionists that don’t want to use odd/even.
-
SplitExtended – improved VB split function with group characters
Based on SplitEx by Chip Pearson, SplitExtended is optimised to be over double the speed, with fixes and additional features; Features over the standard VB Split are; grouping characters, no longer split strings in quotes, ignore consecutive delimiters, while preserving those in grouping characters, option to remove grouping characters, start and end quotes can be…
-
Review of A-PDF Page Cut – software to split a pdf page in half
I came into the requirement of needing to split the pages of a pdf in half, normally this is required when you scan a book and have two pages per scan, but my specific example was a Lonely Planet digital publication which for some reason was released similarly, as I wanted to view it on…
-
VBA/VB6 functions to return folder or file type and date modified.
Here are two quick functions; The first getType takes in a path of a folder or file and returns the type. The second function getDate takes in a folder or path and returns the date modified. getDate references getType.
-
VB6/VBA functions to convert binary string to Base64 string
Here are some functions to convert a binary string, to a byte array, to a Base64 string and then back to a byte array and binary string. Run tester to see it in action, enjoy. Thanks to Tim Hastings for the Base64 functions.
-
Photoshop VBScript to automatically resize images
Decided to learn Photoshop VBScripting, don’t know why I didn’t do this sooner, I now have scripts to automatically generate my blog thumbnails (as below), and add little Google Maps markers on them (see here). A few constants to change in the script (edit with Notepad); RESIZEWIDTH – thumbnail width RESIZEHEIGHT – thumbnail height IGNOREVERTICAL…
-
Simple Ping function VBScript
I was after a ping function that met the following constraints; Didn’t use GetObject. Didn’t display any command (cmd) prompt. Didn’t use a temporary file. Here is what I found; I was looking at a way to timeout the above ping function after 1 second using threading, but this didn’t quite make it so simple.…