Calculate Working Hours in VBA

Tuesday, June 24th, 2008 1,447 views

In the spirit of my last post Calculate Working Days Minus Holidays in VBA, here is a function I wrote recently that returns the number of working hours between two date/time values passed to the function as arguments. It is self-contained and works independently of whatever existing code you have, ...

Calculate Working Days Minus Holidays in VBA

Tuesday, June 17th, 2008 547 views

I was looking for a function that calculates working days, minus holidays, for a small project I've been working on. I decided to write one myself, but below I've also demonstrated an alternate way that uses the ATP (Analysis ToolPak) functions for VBA.   Function WorkDays(StartDate As Variant, EndDate As Variant) ...

Highlight And Move Multiple Emails

Friday, May 30th, 2008 193 views

Okay so I said I would be writing some VBA code to export contacts and emails from Outlook to Excel, well, I lied, sort of. That code is still coming, but before I post it, here is a routine that lets you run VBA code on multiple messages at the ...

Open Any Email Attachment From Outlook

Thursday, May 29th, 2008 180 views

I was inspired to write some VBA code that lets you open any attachment in its native application by a recent newsgroup post from Outlook MVP Sue Mosher. The truth is I was bored, and it was easy to code because I simply reused code I had just written for ...

XML Parsing Function

Wednesday, May 28th, 2008 92 views

In keeping with my Website XML parsing post, here is a short function that returns the body text from a webpage as a string, on which you can use other functions like Instr, Left$, Mid$, etc, to extract necessary data. Function URLText(sURL As String) As String ' check website.com using xml ' early ...

Save Incoming Attachments, Choose Your Folder

Friday, May 23rd, 2008 140 views

Here's a sub and a function for Outlook that let's you save attachments from a selected or open email. It's similar to the File>Save Attachments menu option, which lets you save all of the attachments from a particular email, or the FindControl Method, which can be used to find and ...

Read those image files in Outlook

Thursday, May 22nd, 2008 89 views

I recently discovered a new object library that seems pretty useful - the Microsoft Office Document Imaging Type Library. From the MSDN site: The Microsoft® Office Document Imaging 2003 (MODI) object model makes it possible to develop custom applications for managing document images (such as scanned and faxed documents) and the ...

Outlook Automated File Request System

Tuesday, May 13th, 2008 113 views

Here is the finished code for the Outlook File Request System.File Server CodeThis is event code which acts as an automated file server, putting files into the specified folder, and sending files back to the requestor, all via email. Once the code is installed, another user requests a file from ...

VBA Rant #1

Thursday, May 8th, 2008 38 views

I'm sure by now you are aware that Microsoft has been distancing itself from VBA. As of July 1, 2007, they are no longer licensing VBA (to new clients). For example, if you wrote a program today and wanted to integrate VBA in it, you are out of luck. And the new ...

Excel training class and Outlook file request system updates

Saturday, May 3rd, 2008 13 views

I've been mentioning the Excel training class for some time now, finally the curriculum is coming together and I finally got off my lazy butt and have almost completed the handouts and sample worksheets. I am hoping with fingers crossed to have this finally completed by the end of next ...