Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel.Range.set_Value causing "Exception from HRESULT: 0x800A03EC"

I'm writing an app to take an XML doc and turn it into a spreadsheet. I've
got it working with one section of the XML, but am getting "Exception from
HRESULT: 0x800A03EC" as another section is being inserted. The process is to
take the XML, convert it to a text file, convert the text to an array, and
insert the array as a dataset:

Excel.Application tds = new Excel.Application();
Excel.Workbooks tdsWorkBooks = (Excel.Workbooks)tds.Workbooks;
Excel.Workbook tdsWorkBook =
tds.Workbooks.Add(Excel.XlWBATemplate.xlWBATWorksh eet);

using (StreamWriter sw = new StreamWriter(filePath))
{
//Create the text file
}

Excel.Sheets tdsSheets = tdsWorkBook.Sheets;
Excel.Worksheet tdsWorkSheet = (Excel.Worksheet)tdsSheets.Add(tdsSheets[1],
Type.Missing, Type.Missing, Type.Missing);
object[,] tdsData = new Object[rows, 7];

//Convert the text to an array
using (StreamReader sr = new StreamReader(filePath))
{
int r = 0;
while ((tdsBuildArray = sr.ReadLine()) != null && r < rows)
{
string[] idArray = tdsBuildArray.Split("|".ToCharArray());
tdsData[r, 0] = idArray[0];
tdsData[r, 1] = idArray[1];
tdsData[r, 2] = idArray[2];
tdsData[r, 3] = idArray[3];
tdsData[r, 4] = idArray[4];
tdsData[r, 5] = idArray[5];
tdsData[r, 6] = idArray[6];
r++;
}
}
string iRange = "G" + rows.ToString();

//Insert the array as a dataset. This is where the break occurs
Excel.Range tdsRange = tdsWorkSheet.get_Range("A1", iRange);
tdsRange.set_Value(Type.Missing, tdsData);
tdsWorkSheet.Name = "Edit Specifications";
tdsWorkSheet = null;
tds.Quit();


I would appreciate any suggestions as to how to correct this issue. Thanks.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception from HRESULT: 0x800A03EC at Excel.Workbooks.Open sirrach Excel Programming 0 December 3rd 08 01:35 PM
Exception from HRESULT: 0x800A03EC when setting string in Range.Value2 field [email protected] Excel Programming 1 March 15th 07 03:27 PM
Exception from HRESULT: 0x800A03EC while binding values to a range Jignesh Gandhi[_2_] Excel Programming 0 February 26th 07 07:36 PM
Copy a worksheet throws "Exception from HRESULT: 0x800A03EC." i3tech Excel Programming 4 August 15th 06 01:37 PM
Chart.Export throws COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC. Steven Excel Programming 1 November 5th 03 06:59 PM


All times are GMT +1. The time now is 08:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"