ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   I Dunno (https://www.excelbanter.com/excel-programming/391397-i-dunno.html)

KevinB

I Dunno
 
I'm getting an error on the line with the *****

HRESULT: 0x800A03EC. I've seen this error so many times in so many
instances but I can't seem to figure out why I'm getting it here. Perhaps my
indexes are are throwing it out of bounds? How do I test for this? I placed
an if statement prior to that line testing
((Excel.Range)oSheet.Cells[prodNumsRow, localColumnCount]) != null but I
think it's alway != null. This is becoming a fairly complex app and if you
need me to explain the whole thing then so be it. As you can see I'm testing
that nextItem is != null and getting rid of any extra spaces, not the problem.

Somebody help, I'm sick of this thing.

if (ds.Tables[0].Rows.Count 0)
{
foreach (DataRow dr in ds.Tables[0].Rows)
{
object[] items = dr.ItemArray;

foreach (object o in items)
{
string nextItem = "";
nextItem = o.ToString().Trim();

if (nextItem != null)
{
***** ((Excel.Range)oSheet.Cells[prodNumsRow, localColumnCount]).Value2 =
nextItem;
}
errCount++; //ignore this
localColumnCount++;
}
}
}

Thank you
KB
--
Kevin C. Brown
Developer

Susan

I Dunno
 
this doesn't look like vba to me..................... is it?
:?
susan

On Jun 15, 11:30 am, KevinB wrote:
I'm getting an error on the line with the *****

HRESULT: 0x800A03EC. I've seen this error so many times in so many
instances but I can't seem to figure out why I'm getting it here. Perhaps my
indexes are are throwing it out of bounds? How do I test for this? I placed
an if statement prior to that line testing
((Excel.Range)oSheet.Cells[prodNumsRow, localColumnCount]) != null but I
think it's alway != null. This is becoming a fairly complex app and if you
need me to explain the whole thing then so be it. As you can see I'm testing
that nextItem is != null and getting rid of any extra spaces, not the problem.

Somebody help, I'm sick of this thing.

if (ds.Tables[0].Rows.Count 0)
{
foreach (DataRow dr in ds.Tables[0].Rows)
{
object[] items = dr.ItemArray;

foreach (object o in items)
{
string nextItem = "";
nextItem = o.ToString().Trim();

if (nextItem != null)
{
***** ((Excel.Range)oSheet.Cells[prodNumsRow, localColumnCount]).Value2 =
nextItem;
}
errCount++; //ignore this
localColumnCount++;
}
}
}

Thank you
KB
--
Kevin C. Brown
Developer




KevinB

I Dunno
 
I'm sorry, is this a VBA only group? No, this is C# I appologize. My app is
in .Net but i thought i'd be able get some help from people here. If anyone
knows where I can get some .Net help on this topic I'm open to anything at
this point.

Thanks

KB
--
Kevin C. Brown
Developer


"Susan" wrote:

this doesn't look like vba to me..................... is it?
:?
susan

On Jun 15, 11:30 am, KevinB wrote:
I'm getting an error on the line with the *****

HRESULT: 0x800A03EC. I've seen this error so many times in so many
instances but I can't seem to figure out why I'm getting it here. Perhaps my
indexes are are throwing it out of bounds? How do I test for this? I placed
an if statement prior to that line testing
((Excel.Range)oSheet.Cells[prodNumsRow, localColumnCount]) != null but I
think it's alway != null. This is becoming a fairly complex app and if you
need me to explain the whole thing then so be it. As you can see I'm testing
that nextItem is != null and getting rid of any extra spaces, not the problem.

Somebody help, I'm sick of this thing.

if (ds.Tables[0].Rows.Count 0)
{
foreach (DataRow dr in ds.Tables[0].Rows)
{
object[] items = dr.ItemArray;

foreach (object o in items)
{
string nextItem = "";
nextItem = o.ToString().Trim();

if (nextItem != null)
{
***** ((Excel.Range)oSheet.Cells[prodNumsRow, localColumnCount]).Value2 =
nextItem;
}
errCount++; //ignore this
localColumnCount++;
}
}
}

Thank you
KB
--
Kevin C. Brown
Developer






All times are GMT +1. The time now is 05:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com