0

So I'm attempting to write a big ol' bunch of records I pulled out of an SQL database and sorted to an excel document using C#.

The problem I'm having is it works fine for exactly 207159 rows. Any more than that and it throws up an error, 0x800A03EC

Clearly it's not getting stuck on the old Excel row limit. Clearly it's not getting stuck on the new Excel row limit. I'm completely stumped on this one!

I have somewhere in the region of 350 000 records to write to an Excel document.

The error is occurring during the call to set the value of the range property of the sheet. It won't do it when it is higher than the particular number I am passing to it. Any suggestions?

UPDATE:

I solved this by calling the ToShortDateString() method of DateTime. It didn't like the time element of the DateTime. Strange really as the time was always 00:00:00

Alex
  • 23,004
  • 4
  • 39
  • 73
Mark
  • 155
  • 3
  • 16
  • 1
    How are you generating the file? – Jakub Konecki Nov 14 '13 at 14:07
  • You'll need to show some code; that error code generally means "Name not found". – Allan Elder Nov 14 '13 at 14:10
  • Have you tried removing/commenting row 207160? Maybe you are running into a different limitation? http://office.microsoft.com/en-001/excel-help/excel-specifications-and-limits-HP010342495.aspx?CTT=5&origin=HP005199291 – Sam Nov 14 '13 at 14:14
  • Sometimes this happens when you try working with an xls file in excel 2007+ , try saving the file as xlsx if it is not already. – user2140261 Nov 14 '13 at 15:15
  • I am already saving as xlsx. It is using the Excel package version 12.0. Could there be a setting somewhere that's asking it to use the xls file format, despite me using the xlsx extension? It is just a file name after all – Mark Nov 14 '13 at 15:23
  • If you solved the problem, add and accept an answer to your own question. This will keep it from showing up in the unanswered questions, and it will make it easier for people with the same problem pinpoint to find it. – valverij Nov 18 '13 at 14:17

3 Answers3

0

I've recently created a report that outputs to excel and came accross a similar issue before.

The error code 0x800A03EC (or -2146827284) means NAME_NOT_FOUND; you've asked for something, and Excel can't find it.

Hopefully the code I came up with to solve a similar issue can be of some assistance to you.

                    try
                    {

                     //MyData

                    catch (Exception COMException_HRESULT)
                    {
                        Console.Write(" 0x800AC472 is the VBA_E_IGNORE error that is returned whenever an object model call is invoked while the property browser is suspended.", COMException_HRESULT);

                    }
  • I am literally just writing a bunch of ints, DateTimes and Strings to the cells and saving it. I can't see why a "name not found" would have anything at all to do with anything unless it was failing to write to the file specified, which it's not. – Mark Nov 14 '13 at 14:57
0

Is the 207159 row always the same or is it a different row? On that had the same problem: HRESULT: 0x800A03EC on Worksheet.range

Community
  • 1
  • 1
C0d1ngJammer
  • 550
  • 1
  • 6
  • 21
  • pretty sure it's always the same. I already had a look at the data and it's nothing out of the ordinary. – Mark Nov 14 '13 at 14:51
0

Used ToShortDateString() method of DateTime. The problem was the time element of the datetime, which it didn't like for some reason

Mark
  • 155
  • 3
  • 16