Sunday, September 29, 2013

VBA software development workflow for beginners using Git

Following on from my previous blog, now that we have Dropbox to hold our files together sorted. The next step is to allow changes made to these files into Git to track my changes made over time during the software development cycle.

So what is Git? A software (cloud based) solution to hold a snapshot of your file changed made over time and also to allow other people to create a branch from your code changes if you choose to.

In context, a practical and well known version control software. Git is an active member of the Software Freedom Conservancy which is a non for profit organization that promotes open source projects under the Creative Common License. Here is their free ebook from Git as background reading.

Let's get started...

I'm highly recommending our newcomers to have a go using their interactive web lessons learning from scratch what and to know how their Git "shell commands" are.

Download from Github their Windows / Mac / Linux platform of software onto your desktop, following their directions from the article to help set up your identity for Git and name your initial repository then your all set to go.

I prefer to use Git Shell than the graphical interface as this allows my fingers type away on the keyboard to ask Git to act on files I'm ready to import into my Git repository.

So, once I click on Git Shell icon which opens up the black dialog box. As indicated from my previous blog page. I have set up a directory for groceries from Dropbox. This is shown as a mapped drive letter Y:\ as my suggestion to save time locating the directory where ever you set up on your PC.

Y:\>cd groceries

The next thing to do is to initialize the directory for Git.

Y:\groceries>git init

Git will create some hidden files along the lines of "Initialized empty Git repository in Y:/groceries/.git".

A good programming habit to develop here is to always check the current status of what Git has before continuing.

Y:\groceries>git status

This shows a message that master is the first branch of changes and no other commits available (if shared with other people as they will have their own branches to update with your master)

# On branch master
# Initial commit
nothing to commit (create/copy files and use "git add" to track)

I will have placed a copy (using explorer onto this location) of my Excel file "groceries.xlsm" which basically acts a template going forward. I need to add this onto a staging area so Git has something to work with before committing my changes onto Github web page. While typing in "git add groce" you can use the TAB key to speed up typing the command to save time as the Git shell will recognise you wanted to complete the rest quickly.

Y:\groceries>git add groceries.xlsm
Y:\groceries>git add

also need to ensure there is a file. Readme file allows people on your Github have an idea what the repository is all about which we can update all sorts of useful information as we go along. "md" is short for markdown which I provide a link here that expands this concept better than I could.

Now I am ready to commit into Git.

Y:\groceries>git commit -m "J&J Groceries and first template"

then several message will display the result of committing your changes with the master. All this is doing at the moment is sitting on the "development side" of the equation (on Dropbox). To put this on the "production side" (to the cloud like Git) so to speak, we need to push the changes over to Github. Using the Github identity you have made eariler, you will have a secure web page address (with https://) which you can push your changes onto your web page. I have already set mine, the interactive web page provides a good example for you to do one.

Y:\groceries>git push

however when you examine my own Github page. I have made some prior commits as a test to check things are looking good. Now to see what changes I have actually made, you can visit my Github website, click on groceries.xlsm and select view raw to download yourself a copy to see what's happening.

Please let me know if there are issues arises attempt to find and see the groceries.xlsm file.

Next, let see if I could get a software like Jerkins to pick up my any changes directly from Github to do its own testing separately of what I made in production works.

Til then,

VBA software development workflow for beginners using Dropbox

This blog gives everyone the latest update from me on software development I want to adapt going forward.

I'll begin by talking about software development as I know it to date, followed by how I would go about it using Dropbox to manage my work files in progress, using Git to store my Excel changes accordingly and I hope later using Jerkins to see how the changes I made can be impacted and registered to do some other kind of things.


Talking in general about what software development is. In essence it is the practice of both, the discipline and the art of creating effective software. Taking the traditional path, known by various names as the waterfall approach, from the late sixties to the nineties, stages of collecting requirements ("what do you want the software to do") before designing the software ("how are we to write software"), also constructing the software before testing the software to see if it works. Release is the last stage to provide software out the to customer.

In contrast, in the twenties, Manifesto for Agile Software Development [WWW Document], n.d. URL (accessed 20/07/13) is a website showing the dedication of software developers who were invited over a few days to examine software development challenges. The manifesto is the conclusion whereby they valued items listed on the left more than topics indicated on the right.

Agile methodology following the manifesto's spirit is a style of delivering software often to/for the customer using a small group of mixed skilled people that iterate (repeat) smaller cycles called sprints. Before the cycle starts there is an an agreed prioritized list of stories (requirements) which the allocated team will estimate how long it will take to deliver and once agreed the team will use the sprint to produce/deliver the results for review and feedback.

I have been reading from Scott Sehlhorst who has a software consulting and project management website about the company of the same name "TynerBlain LLC". For a while I enjoy reading his tips/ideas on how to address software development issues from a product's point of view. One of his article he quoted and mentioned from a guest post Wayne Mulligan for "On Product Management" who discusses the challenges in implementing Agile over traditional software development processes. I find this an interesting contribution along the lines of how Agile works.

On the same note, how would Agile work on a personal level? If software contains features and these features are ranked in order of importance to be done. Personal life-goal's vision can be managed this way into three categories, to do, doing and done. I have come across an excellent ebook on Agile developed by an Agile coach whom applied the principles to her own family. Ronen-Harel, S., Kovatch, D., Kaye, A., 2011. Agile Kids, 1 edition. ed. ButterKnife Marketing.

For all sense and purposes, I'll will be using some parts of agile for my own software development. Trello by Fog Creek software is a great product I find on the web for flexibility to manage both the vision of this blog and projects.

Below are the tools I've elected to build our Excel application further which readers is welcome to use.


Let's start with Dropbox first. I choose Dropbox as a secure and reliable means to save files/photo snaps and store my development work over the internet/cloud. In other words, I can show some development by login onto the internet anywhere that suits me in order to share my work in progress. The good news it is free for use with initial space once you register your details. Perhaps later once you decide to share the directories or files, dropbox rewards you with additional space. Interesting way to spread the word so to speak. :-)

To set up Dropbox for development work, we need to download the latest version for Windows desktop to help manage files within Window. I also respect Mac users for Excel so I'm sure Dropbox does supports Macs desktop tools as well. Macs may have something similar as their setup, I'm happy to hear any feedback on this note.

This download also helps to set up a connection across the Internet using best practice protection encryption and synchronises the Dropbox account with your changes. Here is an picture which may looks something like this in the tool bar and the green tick on the box to say all changes are updated.

Once Dropbox is installed. I recommend associating a drive letter of your choice to the Dropbox directory. This will improve your programming workflow by switching easily to the drive letter to continue working.

The following table shows the steps needed to complete for using the Windows command dialog box
(to open the command dialog box go to Start->Search field->type in "cmd") or via Windows Explorer for those using the easy to use mouse. We are going to use "groceries" as the project name and I will assume you are located on the root directory of your Dropbox or switched by drive letter of your choice mapped to that drive letter.

Instructions / Steps
In Command Box
In Window Explorer
Create directory called “groceries
mkdir groceries
File->New->Folder->type in groceries

This is a very simple set up. I'll talk about the next blog about where and how the files are managed before imported into Git to store my code changes.

Til then,