ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VSTO HRESULT (https://www.excelbanter.com/excel-programming/394287-vsto-hresult.html)

ACFalcon

VSTO HRESULT
 
I am having an issue that should be simple, but makes no sense. If I run the
following line of code (VSTO with C#).

this.Range["X1"].Value2 = "5";

It works fine. But if I run the following.

string s = "5";
this.Range["X1"].Value2 = s;

It blows up with an HRESULT: 0x800A03EC.....the following gets the same result

object s = "5";
this.Range["X1"].Value2 = s;

I found that this can occur when the CultureInfo for COM is not matching so
I set the CurrentThread's CultureInfo to en-US and the error still
occurred.....Does anyone have any ideas??? I am using Windows XP 64-bit with
Excel 2003 and VS.NET 2005 (VSTO).

Thanks,
ACFalcon


All times are GMT +1. The time now is 07:05 PM.

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