Fog Creek Software
Discussion Board




Source Control -....vba??

Hi, this is probably a stupid question for all you hardcore coders.  I've had no "real" programming experience, per se.  But just recently I spent a few weeks programming in VBA.  I've heard such concepts of Source Control and Unit Tests.  (Just read a bit more about it towards VBA in a recent post)

I will lookinto VBAunit..and see what that can do for me.

My question is more towards source control for vba? or for Excel workbooks in general WITH VBA modules.  Are there programs to do this?

I pretty much just copied old versions of the workbook which contained the source code... Unfortunately I had no real documentation of what was added and such, so if I screwed something up royally.. I would just go back to a "stable" version and kinda start from scratch.

On a side note, also started reading some stuff about outlining software which is something I definitely need ot get started on :)

Anyway, thanks.

Frank
Friday, August 13, 2004

look into something called Harvest.

also, you could look into writing a macro to export your code. then check-in check-out as needed.

we have our doing things manually. it works, but very time consuming.

Patrick
Friday, August 13, 2004

You can use source control - you'll be checking in the entire Excel document.  I actually do this with SubVersion. 

The only thing to be aware of is non-VBA content.  My program references a database and populates many sheets.  I don't want this data to be part of the version control system (it's too much and it's always different).  So be sure to clear that stuff out before you check it in.

Other than that, you're set.

Lou
Friday, August 13, 2004

I'm not sure which version of Office you are using, but I remember that way back with Office 97, I used the Visual SourceSafe Add-In on a project in Access.  I assume there is still similar functionality for the current Office versions.  Poke around on MSDN and you should be able to find something.  This article might help:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/modcore/html/deconchoosingrightsourcecodecontroladdin.asp

Tim Lara
Friday, August 13, 2004

Source Control - any source control will do.  Sourcesafe, CVS, or Subversion are pretty much easily available.

You will just be checking in changes to files (depending on which platform you use) and thats a start. 

Unit testing is a good start, but remember, it doesn't guarantee anything, so focus more on using your brain and integration testing.    (Your boss won't care that you have 10 unit tests that show green lights if the program breaks - in fact, s/he'll think the unit tests were a waste of time.  So be careful there...)

Crackhead
Friday, August 13, 2004

Thanks for the quick replies.

So... when you update files say on CVS....is there a way to state what changes have been added.

Perhaps i'm just a really poor programmer and need to get organised.  But say you're uploading/backingup a working copy of the code and you want to attach a description like: Aug 13, Implemented dialog box xxx with full functionality.

Is this possible?  Or is this something I should have written in comments within the source anyway (a nice header file for example :)

But it would still be quicker to go through old backups to find exactly the one you where looking for... If for example a whole section got cut out of the specs so you want to go back to before you started adding this new section... say 14 backups earlier.

Frank

Frank
Friday, August 13, 2004

That's exactly what source code control is for. You are asked for comments when you check in.

And if you put in "Misc Bugfixes" as the comment, people will hate you.

Miles Archer
Friday, August 13, 2004

> So... when you update files say on CVS....is there a
> way to state what changes have been added.

Yes indeed. Source control is designed to make the tracking of changes easy.

If you want to play around with CVS take a look at the Zeus for Windows editor:

  http://www.zeusedit.com/lookmain.html

It comes with CVS support which means to get started all you need to do is create Zeus project workspace, add your source files to the project, then add project to a CVS repsitory.

From then on your files are under version control and you can track any changes you make to the file.

Jussi Jumppanen
Saturday, August 14, 2004

Frank,

take a look at www.squarewavecorp.com

squarewave sells "Source Control For Applications", which is a vba add-in that integrates directly into
VBA environment and allows you to checkin, checkout, diff,
show history etc of all vba project modules..

I have recently heard that Microsoft has
discontinued its VBA addin for source control
with the release of Office 2003, and SCA is a suitable replacement for it.

steve

Steve Sciandra
Wednesday, September 01, 2004

*  Recent Topics

*  Fog Creek Home