Sunday, April 5, 2009

Microsoft Excel Leading Zeros on CSV import.

I've seen this question posed on various forums and for the most part, the answer is always something beyond a direct answer to the simple question of "how can I have Excel open a csv file and keep the leading zeros in a column intact?". Most of answers give a solution that calls for some level of manual manipulation beyond what is the intent of the question.

In my case, I wanted to create a comma delimited file on a mainframe and have the mainframe send out the file as an email attachement via SMTP. I wanted the said attachment to be a csv attachment that could be clicked on by the recipient to automatically launch Excel with the contents of the attachment. I didn't want the user to have to save a text file and import, or run some kind of macro, or mess around with text to columns, etc. I just wanted the user to be able to click on the file to launch the csv file in Excel, while keeping the leading zeros. Period.

What worked for me was formating the data as ="0098765".

Wednesday, January 23, 2008

Microsoft Word 2007 icon issue for doc

I had an issue with file manager showing the Wordpad icon and file type of Wordpad even though doc files were associated with MS Word 2007. Double clicking doc files correctly opened them in Word but the icon was still not correct. Call me anal but I searched high and low for a solution.

I tried the obvious path of Tools, Folder Options, File Types, select DOC, selecting change and choosing Word...to no success. I tried using the run command line with "winword /r" to re-register Word files. I tried doing a repair install on Office 2007, and I even tried editing the registry. No luck so far.

The good news is I finally figured out something that worked. Going back to the ol' Tools menu, Folder Options, File Types option in Windows explorer, I instead hit 'New', which brought up a 'Create New Extension' box. I entered the file extension of 'doc' and clicked on Advanced and selected 'Microsoft Office Word Document', then hit 'OK'. It warned me that the extension was already assigned to Wordpad and asked me if I wanted to update with my new selection. I accepted and from there, the icon and type refreshed to the proper values.

Labels: , , , ,

Tuesday, January 30, 2007

First Blog - Testing the waters

Blah blah blah