11-28-2007
Bizarre Bug of the week - SYLK file
I’ve just been working on a quick way to allow a client to view their email subscriptions from their site. They request the correct page which reads the database table, creates a csv file, then emails it as an attachment. Fine - worked first time. Just need to add the column names in the first line of the file. The first column, as is often the case, is the primary key called “id”. So, the first two characters in the file become “ID”.
Bug!
When I click on my attachment in my inbox, Excel gives me this message:
Excel has detected that ‘emails.csv’ is a SYLK file, but cannot load it. Either the file has errors or it is not a SYLK file format. Click OK to try to open the file in a different format.
Admittedly not the most serious bug in the world, it does look crap and possibly might worry an end user. Quick Google search to find this explanation: “SYLK: File format is not valid” error message when you open file
The solution? Change the first two characters of the file so that the file does not begin with uppercase “ID” - even lowercase “id” will work. I changed mine to ItemID and I was away.
So play safe with those csv files kids!
Posted by dotnetdave in .NET 2.0 Development | RSS 2.0






