Excel Visual Basic Last Saved Date Time Stamp

I wanted to add a last saved date and time stamp to an Excel worksheet. In some cases, I would want this information displayed in a cell. Other times, I want it displayed in the header or footer of the document (when printed).

Here is the Visual Basic script code that shows how to do either:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    'Calculate the date and time stamp string
    Dim TS As Date
    TS = Now
    Dim TSS As String
    TSS = FormatDateTime(TS, 1) & " " & FormatDateTime(TS, 3)

    'Place time stamp into the cell labeled SaveTimestamp
    'Range("SaveTimestamp").Value = TSS

    'Place time stamp into the header or footer for printing
    Dim WS As Worksheet
    For Each WS In Worksheets
        WS.PageSetup.CenterFooter = "Last modified on " & TSS
        'WS.PageSetup.LeftFooter = ThisWorkbook.FullName
    Next WS
End Sub

That script will update the contents of the footer for every worksheet in the workbook to display the last saved date and time like this:

Last modified on Wednesday, November 17, 2010 12:54:01 PM

There is also commented-out functionality to update a labeled cell (called SaveTimestamp in the script above) with the last saved date and time.

In order to use the script, while in an Excel workbook open the Visual Basic editor (shortcut is Alt+F11). In the VBAProject window, on the left-hand side, double-click on ThisWorkbook. Paste the script into the code window and save.

The code completion in the Visual Basic script editor is very helpful. If you wanted to make the last saved date and time appear on the left-hand side of the header (for example) that is easily accomplished by changing one line of code (CenterFooter becomes LeftHeader). I left in (and commented out) an example of setting the left footer to be the full path to the workbook file itself. You can easily modify the script for your own purposes.

I used information from both W3Schools and PC Magazine for this solution.

Posted on November 17, 2010 at 5:30 pm by Shad Aumann · Permalink · 8 Comments
In: Articles · Tagged with: , , ,

Java Servlet Backend for Plupload

I wanted to use a rich web upload client for a personal project, and in a search I found Plupload.  I am so impressed with Plupload!  You can configure a single upload widget, and it will automatically choose the best rich client technology supported by a client’s browser.  Who decides which rich client technology is best?  You do!  Plupload will use your prioritized list from the following choices: Flash, Gears, HTML 5, Silverlight, BrowserPlus, and HTML 4.  Did I mention Plupload is open source?  It does not get any better than this, folks!

For my project, I created a Java Servlet to receive the multi-part MIME POST request from Plupload.  My solution uses the streaming API from Apache Commons FileUpload.  The nice thing about the streaming API is that your Servlet can receive files that are too large to fit into memory.

Here is a link to (a simplified version of) my implementation of a Java Servlet backend for Plupload.  The ZIP file contains the source code for the Servlet and a JSP dump page that fulfills the same function as the dump.php PHP page that comes with the Plupload distribution.  The Servlet I am sharing is at the demonstration level of quality; it is not the same implementation I would actually use for a real application.  But it is a good demonstration of how to handle the POST from Plupload.  Some of my thoughts on using the Servlet include:

  1. By default, the Servlet saves the uploaded files to the web application server’s temp directory.
  2. Change the package for the Servlet class.  It is currently set to “shadhome”.
  3. Add an entry in your web.xml configuration for the servlet.  The URL that you configure in your web.xml will be the same one you should configure for the page that is using Plupload.
  4. For my project I have limited use for implementing the JSON responses that Plupload can accept, so that part is not very well represented.
  5. Again, this is a demonstration level implementation.  Logging, exception handling, etc. are not well represented.

One final thought: technically this demonstration Servlet would handle saving files from any multi-part MIME POST request (not just from Plupload).

Drop me a note if you end up using this Servlet, or if you have any comments / questions.

UPDATE ON 2011-04-19: Lars has shared his example of a JSP that can receive the HTTP POST request from Plupload.

Gen-XY

My birth-date places me on the time-line border between Gen-X and Gen-Y.  This is an interesting place to be since one of the consequences is that I do not identify strongly with either group.  Some characteristics attributed to Gen-X are appealing to me and some are annoying.  The same goes for Gen-Y.  Instead of my birth-date, I feel like my being a man has had a more profound effect on who I am.  That is why I am hereafter going to consider myself as being a member of Gen-XY!

While I can point to my birth-date as the source of my inability to identify as either Gen-X or Gen-Y, aren’t there an almost unlimited number of reasons for feeling the same way?  Who identifies fully with any stereotype or other arbitrary grouping to which they are perceived to belong?

Making blanket statements about people due to being in Gen-X or Gen-Y seems uncannily like crude attempts at humor containing racism, sexism, or other forms of bigotry.  It’s cheap.  It’s hurtful.  And it’s wrong.  An especially appalling example is this article on the blog, modite.  I think the comparisons and generalizations used in that article are confrontational, bigoted, and short-sighted.

Luckily, since Gen-Z is already upon us, the people who take up these stereotypes and run with them have already run out of letters.

Posted on July 23, 2010 at 7:00 am by Shad Aumann · Permalink · 2 Comments
In: Articles · Tagged with: , , , , , , ,

How to Contact

When contacting people, your likelihood of receiving a timely response will be substantially increased by including your own contact information in a usable format.

What do I mean?  Here is the best possible way to contact me (and I suspect most people; especially technology-savvy folks):

Here is an example of the worst-possible way to contact me:

I understand that a phone call is often the best way to communicate.  But the likelihood of you calling me unscheduled and my being able to take your call and deal with our communication immediately is remote.  And I’m practically a nobody.  Imagine how unlikely this is for other, more important people!

I am pleasantly surprised by voice mails that say something like, “Hello, this is John Smith from SomeCompany.  I am calling about the important thing, and will follow up this call via email.”  John Smith called me from the number he wants me to use to call him back.  My phone already has the number from caller ID, so he did not have to speak it onto the voice mail.  John is also going to send me an email containing the details of why he called me, including his contact information in a format that can be parsed by my phone.

Thanks for saving me time and effort responding to you, John – you are going to hear back from me as soon as possible!

Posted on July 22, 2010 at 7:23 am by Shad Aumann · Permalink · Leave a comment
In: Articles · Tagged with: , , , , ,

Javadoc WIN – Map.keySet()

This week, I was writing a class that implements the Set interface but uses a Map internally to track usage information about the contents of the Set.  I was implementing the removeAll() method, and wanted to use an Iterator over the Set returned by Map.keySet() in my method.

My question was, will the remove() method from an Iterator over a Set returned by Map.keySet() un-map the item from the underlying Map?

The answer is yes!

The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll retainAll, and clear operations. It does not support the add or addAll operations.

That is some fine documentation, folks!  As developers on our own systems, we know that our peers can always look at the code and try to figure out what is going on.  But, having documentation that allows the clients of your class to easily answer questions is vastly superior to people regularly resorting to looking at your code.

Posted on January 8, 2010 at 11:45 am by Shad Aumann · Permalink · Leave a comment
In: Articles · Tagged with: , , ,

JavaOne 2004 Presentation

Believe it or not, I still receive occasional requests for the presentation I co-authored/delivered with Robert A. Cross, Ph.D. at the 2004 JavaOne conference.  Without further ado, here is a link to Large-Scale, High-Bandwidth Video and Robotic Camera Control With Java™ Technology.

JavaOne Presentation Title Slide

Posted on November 4, 2009 at 2:30 pm by Shad Aumann · Permalink · One Comment
In: Articles · Tagged with: , ,

WSOB EvMBA Class of 2012 Orientation

Monday, August 24th is the orientation for the incoming Class of 2012 in the Wisconsin School of Business (WSOB) Evening MBA Program.  As a member of the Student Advisory Board (SAB), I am helping present information to the incoming class from an experienced student’s perspective, this being my third and final year in the program.

There are three main things SAB members want to achieve by attending orientation:

  1. Meeting and welcoming the members of the incoming cohort.  We can help jump-start their sense of belonging within the Enterprise MBA Program and the greater WSOB community.  Plus, we get to meet them before everyone else.  Score!
  2. Explaining our means of effecting change in our program, the Student Advisory Board.  We will discuss the history of the SAB, what we do, and how the upcoming elections will operate.
  3. Presenting experienced MBA student perspectives.  Until you are actually in an MBA program, it is difficult to know which skills, behaviors, and activities are necessary to optimize one’s experience in the program.  For example, it will seem to them as if they are being invited to an indistinct, endless array of events.  But in reality, many events are rare opportunities only available to members of the WSOB.

I enjoy being a part of events like this.  This is one of the greatest things about being in a three-year, lockstep, cohort program: when you start, you get to meet your cohort and the two years ahead of yours.  By the time you are in your third and final year of the program, you have additionally met the two years behind yours.  A person in the WSOB Evening MBA Program can know 300 to 400 professionals with MBAs by the time they finish!

The backgrounds, skills, and experiences of our fellow program members are rich and varied.  My mission during the orientation will be to encourage the members of the Class of 2012 to meet as many of the students in the program as they can.

Posted on August 23, 2009 at 9:48 pm by Shad Aumann · Permalink · 5 Comments
In: Articles · Tagged with: , , ,

Class Trip to Beijing

My classmates and I at the Wisconsin School of Business are taking a trip to Beijing, China starting on June 19.  This trip marks the conclusion of the second year of our three-year Evening MBA Program.  To say that we have been looking forward to it would be an extreme understatement.

For the past several months, we have been contacting businesses who have offices in Beijing, coordinating either having our entire class visit their facility or having representatives from their company visit us in the conference center of our hotel.  (Some companies are not set up to handle a visiting group of 60 people!)  The list of companies we will be meeting with is an impressive who’s who:  Kimberly Clark, IBM, Li & Fung, Lenovo, GE Healthcare, Cummins, Procter & Gamble, and Johnson Controls.

I had a really neat experience setting up my team’s site visit to IBM.  A friend of mine, Mike Payne, has been working at IBM for over 10 years.  Mike and I first met during our days as undergraduates at UW-Madison, struggling through the computer science curriculum together.  Earlier this year, when I asked if he had any contacts at their facilities in Beijing, he was able to connect me with the event manager for IBM’s brand-new Supply Chain Innovation Center.  This is a major score for a bunch of strategic management MBA geeks!

Posted on June 5, 2009 at 3:15 pm by Shad Aumann · Permalink · Leave a comment
In: Articles · Tagged with: , , , ,

Personal Business Card

I recently ordered a new set of personal business cards from VistaPrint using their online design service:

One thing you cannot easily tell from the image above is that the horizontal red line underneath my name is done in red foil on the physical card.  The foil effect looks really – really – cool.  (And, through the transitive property of equality, makes the cardholder look cool.)

My primary reason for having a personal card is that when I am out at events, I am representing myself, not my employer.  I want to promote the Shad Aumann brand:  blogger, IT leader, MBA guy, social networking guy, photographer guy, skier guy, golfer guy, public speaker.  Maybe I just should have put all that on the card!

Penelope Trunk at Accelerate Madison Event

I joined Accelerate Madison on Wednesday, May 13 because I wanted to go see Madison’s most famous blogger, Penelope Trunk, speak at their event that evening.  I thought maybe I would get to meet her, or to say something memorable and witty to an attendee who would remember my name and be compelled to offer me my dream job.

I did not have to be a member of Accelerate Madison to attend the event, but the entry fee for non-members was $35.  Since a friend and I both wanted to go, I figured I would join.  Then both of us could participate for “free” and I would be instantly getting $70 back on my $185 yearly membership fee.  Plus, when there’s an all-inclusive, deluxe way to do something, that’s how I tend to do it.  (For this reason, my wife and I established a 3-day waiting period before I am allowed to set foot into a golf equipment store.)

Two notable things happened at this event:  I did get to meet Penelope Trunk and the group of people in attendance got to exhibit their inexperience with social networking.

As my friend and I stepped into the elevator at the Fluno Center, he suggested I hold the door for the woman heading across the parking garage.  I held the door, and as the woman approached, I half-whispered to my friend, “I think that’s Penelope Trunk!  I mean, I’m not sure, since I only know her face from the picture on her blog, but it really looks like her!  What do you think we should….”  By then, time had run out to talk about the situation.  She boarded the elevator and I suddenly and unexpectedly found myself standing right next to our famous, esteemed, very tall speaker for the evening.

And I am not afraid to admit I found myself more than a little bit star-struck!

Like a gazillion other people, I read her blog, and since her posts convey so much about her, I was overcome by the same self-conscious feeling you get when a person you’ve been innocently observing suddenly meets your eye.  Not only that, but she is also so accomplished, she has chosen to run her latest startup here in Madison, and she was the speaker that evening – I felt a lump growing in my throat!

But wait!  I’m going to business school, dammit!  I am getting an MBA!  I have an elevator pitch!  I’m going to lay it on her and blow her mind!

But wait.  Doesn’t she write extensively in her blog about how going to graduate school – especially for business – can be a fool’s errand?

But wait!  I disagree with her when she writes things like that!

But wait.  It’s just a short elevator ride.  Better say something, quick.

“We’re here to see you speak tonight,” I say, nodding and smiling.  Penelope takes over, sparing me further deliberation about how best to handle the situation.  She ably guides my friend and me through a round of introductions and even asks us about what we do.  We discover she is familiar with the services of the company I work for.  I try to say something funny and self-deprecating.  Then we’re suddenly in the lobby reception area of the Fluno Center.  It’s time for her to move on and have the other 200 people there try to talk to her.

Later that evening, her talk about BUILDING ONLINE COMMUNITIES & COMPANIES through SOCIAL MEDIA was on-target, her delivery enthusiastic yet casual.  At the conclusion of her talk, she took questions from the audience; most of them apparently still regard social networking as charming, alluring, and mysterious.  Penelope found herself teaching an impromptu session of Social Media 100.

Her most profound statement came at the end of the Q&A session – in which Penelope revealed that in spite of having been running her company in Madison for three years, she had never heard of Accelerate Madison until recently.  I hope the audience understood the relevance of her comment, especially at a talk about BUILDING ONLINE COMMUNITIES & COMPANIES through SOCIAL MEDIA.

Posted on May 15, 2009 at 11:25 am by Shad Aumann · Permalink · 4 Comments
In: Articles · Tagged with: , , ,