Thursday, July 10, 2008
Hot out there
It's not as bad today as yesterday's over 110deg temps were, but when I saw the weather.com "Feels Like" spot, I just had to make a little correction. 

PermaLink / Posted by: Tony
![]() |
"Aut viam inveniam aut faciam" - I will find a way or I will make one. |
Thursday, July 10, 2008
Hot out there
It's not as bad today as yesterday's over 110deg temps were, but when I saw the weather.com "Feels Like" spot, I just had to make a little correction. 

PermaLink / Posted by: Tony
Enhancing Visual Basic scripts with Microsoft Excel - Part 1
“Things alter for the worse spontaneously, if they be not altered for the better designedly.” -Francis Bacon
Effectively working with and administering a Microsoft Windows based enterprise environment, let alone any other, requires making full use of all the tools that are made available to you and more often than not, making do with whatever is freely available. In the open source world of Linux this is generally not a problem as just about anything you could come up with a need for has not only already been created but is freely available and the things that aren’t, you can create yourself using any of the many free tools for scripting and programming that are available to fill those voids.
When it comes to system automation in a closed source environment such as Microsoft’s, the Visual Basic Scripting host is an invaluable tool that will let you handle just about every administrative task possible from mass updates to Active Directory to extensive data gathering and reporting; best of all, it is not only free, but it is already integrated into every Windows desktop. Of course, when it comes to automation you’re generally dealing with decently large amounts of data, either coming in, going out, or both; and while you can use simple text files for many things, it often makes more sense to leverage the power of a spreadsheet for both input and reported data.
I’m not looking to write the definitive article on how you can best use Excel with VBS, but my goal is to provide a good starting point, with a decent selection of sample source code to get the beginner or intermediate VBscripter up to speed and hopefully, leveraging Excel spreadsheets in no time, so let’s get started.
Lesson 1: Getting started
Let’s create a real simple script that simply shows us Excel.
DIM objExcel
DIM objTestSheet
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.WorkBooks.Add
objExcel.ActiveWorkbook.Worksheets.Add
Set objTestSheet = objExcel.ActiveWorkbook.Worksheets(1)
objTestSheet.Name = “Test Sheet”


DIM objExcel
DIM objTestSheet
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.WorkBooks.Add
objExcel.ActiveWorkbook.Worksheets.Add
Set objTestSheet = objExcel.ActiveWorkbook.Worksheets(1)
objTestSheet.Name = “Test Sheet”
For i = 1 to 6
objTestSheet.Cells(1, i).Font.Bold = TRUE
Next
objTestSheet.columns(1).columnWidth = 10
objTestSheet.columns(2).columnWidth = 20
objTestSheet.columns(3).columnWidth = 20
objTestSheet.columns(4).columnWidth = 6
objTestSheet.columns(5).columnWidth = 30
objTestSheet.columns(6).columnWidth = 15
objTestSheet.Cells(1, 1).Value = "Status"
objTestSheet.Cells(1, 2).Value = "Test"
objTestSheet.Cells(1, 3).Value = "Department"
objTestSheet.Cells(1, 4).Value = "Floor"
objTestSheet.Cells(1, 5).Value = "Room/Area"
objTestSheet.Cells(1, 6).Value = "Room #"
objTestSheet.activate
objTestSheet.Rows.item(2).select
objExcel.ActiveWindow.FreezePanes = True


a) objTestSheet.Cells(1, 1).Font.ColorIndex = 3
b) objTestSheet.Cells.autofilter 1, "DOWN"
Labels: DIY, programming
PermaLink / Posted by: Tony
Tuesday, July 01, 2008
Bunnyhop vs Jet Hop or J-Hop
I thought I would eliminate a little confusion over some of the terms that are floating around with regard to the infamous bunnyhop.
A bunnyhop is executed by pulling your front tire up first.
A j-hop is not a new trick, it is simply what people started calling a bunnyhop when people started incorrectly calling it a bunnyhop when someone clipped into a mountain bike would lift the whole bike straight up at once.
Technically speaking, since it is not a new trick and simply a renamed existing trick, there really is no such thing as a j-hop.
PermaLink / Posted by: Tony