Archive for the ‘File Operations’ Category.

Removing Spaces from File Names

I inherited a folder with a bunch of files in it. Almost every file had spaces in the name. I abhor spaces in file names. Also, I need to put these files in Subversion, so the names would have all be encoded so they’d work as URLs. That is, all of [...]

Using Windows 7 Libraries with Older Excel Versions

I’m what you might call a late adopter. My computers all have Windows XP on them. So if sounds like I don’t know what I’m talking about, well, I don’t. But KeepITCool sent me a Windows 7 tip that just has to be shared.
Ars sez
Windows 7 has a new file management concept [...]

Editing elements in an Excel OpenXML file using VBA

Hi Everyone!
Today I finally found time to actually post a brand new article on my website.
Wouldn’t it be useful to be able to edit the contents of an Office 2007 OpenXML file from within VBA? Well, now you can, using the sample code and explanation in this article.
Enjoy!!
Regards,
Jan Karel Pieterse
www.jkp-ads.com

Automated Formulas Testing

When I test formulas on a spreadsheet, it s a very manual process. I’m trying to figure out a way to automate this. Here’s what I have so far.
I want to identify some input cells and output cells. Then record some known good values for the inputs and outputs and store them. [...]

Handling Delimeters in CSV Files

When rolling your own csv files, you have to account for commas in the text. Extra commas will create extra columns and you don’t want that. Let’s start with this data:

Two of the names have commas and two don’t. By ignoring those commas, extra columns are created because a comma delimits a [...]

Increment File Names

I have to save a file that may have the same name as an existing file. If it does, I append a number to the end of it to make it unique. The problem is that the file will live in three different folders in its life; Working, Review, and Archive. I [...]

Excel as a Really Bad Database

Do you know what’s worse than having a bunch of data in an Excel workbook that really should be in a relational database? Having a bunch of data in multiple Excel workbooks that really should be in a relational database. It’s the Excel-workbook-as-a-record model and it’s how we currently store our quotes.
Each quote [...]

The New Excel 2007 File Format

Most of you will know that Excel 2007 (well, Office 2007) comes with a brand new file format, based on what MSFT calls Open XML.
This suddenly enables us to write code that can easily generate/change Office 2007 files without the need for an Office installation. For instance on a server.
Whilst there is proper documentation on [...]