Excel says "Cannot read record 1234" upon opening .SLK file

A

Andrew Bunner

I have an application that writes a .SLK file for consumption by Excel.
It "works" in that Excel can open the SLK file and the
formatting/values are preserved. But Excel reports a whole series of
errors like "Cannot read record <number>".

If I click "No" when Excel asks "Continue reporting each error", the
file appears correctly. But the file is going to be automatically
produced and then consumed by a client--I don't want to ask my client
to "just ignore those errors". I'd rather find a way to produce a SLK
file that didn't cause Excel to report any errors!

I found one thread that talks about the locality making a difference,
but the author didn't say how to fix it.

Here's the first part of my SLK file. Any help would be great!

p.s. We chose SLK format because it has broad support on older versions
of Excel which is important for our clients.

ID;PWXL;N;E
P;PGeneral
P;P0
P;P0.00
P;P#,##0
P;P#,##0.00
P;P#,##0_);;\(#,##0\)
P;P#,##0_);;[Red]\(#,##0\)
P;P#,##0.00_);;\(#,##0.00\)
P;P#,##0.00_);;[Red]\(#,##0.00\)
P;P"$"#,##0_);;\("$"#,##0\)
P;P"$"#,##0_);;[Red]\("$"#,##0\)
P;P"$"#,##0.00_);;\("$"#,##0.00\)
P;P"$"#,##0.00_);;[Red]\("$"#,##0.00\)
P;P0%
P;P0.00%
P;P0.00E+00
P;P##0.0E+0
P;P#\ ?/?
P;P#\ ??/??
P;Pm/d/yyyy
P;Pd\-mmm\-yy
P;Pd\-mmm
P;Pmmm\-yy
P;Ph:mm\ AM/PM
P;Ph:mm:ss\ AM/PM
P;Ph:mm
P;Ph:mm:ss
P;Pm/d/yyyy\ h:mm
P;Pmm:ss
P;Pmm:ss.0
P;P@
P;P[h]:mm:ss
P;P_("$"* #,##0_);;_("$"* \(#,##0\);;_("$"* "-"_);;_(@_)
P;P_(* #,##0_);;_(* \(#,##0\);;_(* "-"_);;_(@_)
F;P30;FG0G;C1
F;P30;FG0G;C2
F;P30;FG0G;C3
F;P30;FG0G;C4
F;P30;FG0G;C5
F;P30;FG0G;C6
F;P30;FG0G;C7
F;P30;FG0G;C8
F;P30;FG0G;C9
F;P30;FG0G;C10
F;P30;FG0G;C11
F;P30;FG0G;C12
F;P30;FG0G;C13
F;P30;FG0G;C14
F;P30;FG0G;C15
C;Y1;X1;N;K"Col1"
C;X2;N;K"Col2"
C;X3;N;K"Col3"
C;X4;N;K"Col4"
C;X5;N;K"Col5"
C;X6;N;K"Col6"
C;X7;N;K"Col7"
C;X8;N;K"Col8"
C;X9;N;K"Col9"
C;X10;N;K"Col10"
C;X11;N;K"Col11"
C;X12;N;K"Col12"
C;X13;N;K"Col13"
C;X14;N;K"Col14"
C;X15;N;K"Col15"
C;X16;N;K"Col16"
F;P30;FG0G;Y2;X1
C;Y2;X1;N;K"123469798903"
C;Y2;X2;N;K"10.00"
C;Y2;X3;N;K"240"
C;Y2;X4;N;K"$10.00"
C;Y2;X5;N;K"53"
C;Y2;X6;N;K"(e-mail address removed)"
C;Y2;X7;N;K"Generic"
C;Y2;X8;N;K""
C;Y2;X9;N;K"Shopper"
C;Y2;X10;N;K"100 Main St"
C;Y2;X11;N;K""
C;Y2;X12;N;K"Belmont"
C;Y2;X13;N;K"CA"
C;Y2;X14;N;K"94002"
C;Y2;X15;N;K"9999999999"
C;Y2;X16;N;K"1416345"
F;P30;FG0G;Y3;X1
 
D

Dave Peterson

This was posted by Myrna Larson:

===========
From - Wed Apr 12 17:18:13 2000
I have a Excel .csv file that somebody in my company e-mailed to me that
they want me to see if I can repair. When I try to open the file I get an
error message that says 'SYLK: file format is not valid'. Is there any way
that I can save this file?

You get this message when the 1st 2 characters in the file are "ID", without
the quotes. So use Notepad or WordPad to change one or both of these
characters. Then import it, then correct the data in the 1st cell.

===========

Maybe it's that "ID" as the first couple of bytes in your text file????

Andrew said:
I have an application that writes a .SLK file for consumption by Excel.
It "works" in that Excel can open the SLK file and the
formatting/values are preserved. But Excel reports a whole series of
errors like "Cannot read record <number>".

If I click "No" when Excel asks "Continue reporting each error", the
file appears correctly. But the file is going to be automatically
produced and then consumed by a client--I don't want to ask my client
to "just ignore those errors". I'd rather find a way to produce a SLK
file that didn't cause Excel to report any errors!

I found one thread that talks about the locality making a difference,
but the author didn't say how to fix it.

Here's the first part of my SLK file. Any help would be great!

p.s. We chose SLK format because it has broad support on older versions
of Excel which is important for our clients.

ID;PWXL;N;E
P;PGeneral
P;P0
P;P0.00
P;P#,##0
P;P#,##0.00
P;P#,##0_);;\(#,##0\)
P;P#,##0_);;[Red]\(#,##0\)
P;P#,##0.00_);;\(#,##0.00\)
P;P#,##0.00_);;[Red]\(#,##0.00\)
P;P"$"#,##0_);;\("$"#,##0\)
P;P"$"#,##0_);;[Red]\("$"#,##0\)
P;P"$"#,##0.00_);;\("$"#,##0.00\)
P;P"$"#,##0.00_);;[Red]\("$"#,##0.00\)
P;P0%
P;P0.00%
P;P0.00E+00
P;P##0.0E+0
P;P#\ ?/?
P;P#\ ??/??
P;Pm/d/yyyy
P;Pd\-mmm\-yy
P;Pd\-mmm
P;Pmmm\-yy
P;Ph:mm\ AM/PM
P;Ph:mm:ss\ AM/PM
P;Ph:mm
P;Ph:mm:ss
P;Pm/d/yyyy\ h:mm
P;Pmm:ss
P;Pmm:ss.0
P;P@
P;P[h]:mm:ss
P;P_("$"* #,##0_);;_("$"* \(#,##0\);;_("$"* "-"_);;_(@_)
P;P_(* #,##0_);;_(* \(#,##0\);;_(* "-"_);;_(@_)
F;P30;FG0G;C1
F;P30;FG0G;C2
F;P30;FG0G;C3
F;P30;FG0G;C4
F;P30;FG0G;C5
F;P30;FG0G;C6
F;P30;FG0G;C7
F;P30;FG0G;C8
F;P30;FG0G;C9
F;P30;FG0G;C10
F;P30;FG0G;C11
F;P30;FG0G;C12
F;P30;FG0G;C13
F;P30;FG0G;C14
F;P30;FG0G;C15
C;Y1;X1;N;K"Col1"
C;X2;N;K"Col2"
C;X3;N;K"Col3"
C;X4;N;K"Col4"
C;X5;N;K"Col5"
C;X6;N;K"Col6"
C;X7;N;K"Col7"
C;X8;N;K"Col8"
C;X9;N;K"Col9"
C;X10;N;K"Col10"
C;X11;N;K"Col11"
C;X12;N;K"Col12"
C;X13;N;K"Col13"
C;X14;N;K"Col14"
C;X15;N;K"Col15"
C;X16;N;K"Col16"
F;P30;FG0G;Y2;X1
C;Y2;X1;N;K"123469798903"
C;Y2;X2;N;K"10.00"
C;Y2;X3;N;K"240"
C;Y2;X4;N;K"$10.00"
C;Y2;X5;N;K"53"
C;Y2;X6;N;K"(e-mail address removed)"
C;Y2;X7;N;K"Generic"
C;Y2;X8;N;K""
C;Y2;X9;N;K"Shopper"
C;Y2;X10;N;K"100 Main St"
C;Y2;X11;N;K""
C;Y2;X12;N;K"Belmont"
C;Y2;X13;N;K"CA"
C;Y2;X14;N;K"94002"
C;Y2;X15;N;K"9999999999"
C;Y2;X16;N;K"1416345"
F;P30;FG0G;Y3;X1
 
A

Andrew Bunner

Thanks, but that's not it. "ID" is definitely supposed to be the first
two characters in a SYLK file. From the SYLK documentation at
http://myfileformats.com/download_info.php?id=4760 :

"Organization of a SYLK File
1. ID must be the first record.
....
7. E must be the last record.
"

Myrna was hepling someone correct a problem with a .CSV file. Mine's a
..SLK file and, I'm pretty sure it should begin with an "ID".

Any other ideas?
 
D

Dave Peterson

Doh!

I remembered _a_ problem--just not _your_ problem.

sorry.

And I don't have any other guess.

I do remember trying this a little while ago. Even though I got the error
message, the data was brought in ok.

Have you checked to see if the values are ok--not withstanding the error
messages.
 
A

Andrew Bunner

All the values are brought in okay. But the error message "looks bad"
when we're delivering the file to a client (in an automated way)
 
D

Dave Peterson

I don't use SLYK files and I don't know what causes the error.

Maybe someone else can jump in.

Sorry.
 
Joined
Sep 17, 2007
Messages
1
Reaction score
0
Andrew,

Were you able to find a solution for your problem? I am getting the same error "cannot read record" when I try to open a .slk file. In case you found out the solution for your problem, could you please share it with me.

Scameron,

Can you tell me at which line you were missing the quote or how did you find out the line which has the missing quote.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top