Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VSTO2005 - HResult Exception obtaining Range Object
When placed in ThisWorkbook_StartUp the following code yields an HResult
Exception: Dim oRange As Microsoft.Office.Interop.Excel.Range oRange = Globals.Sheet1.Range("$A$1") What am I doing wrong? (I will need the range object as a parameter for the Globals.Sheet1.Controls.AddListObject method.) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VSTO2005 - HResult Exception obtaining Range Object
Passing as single cell arguement to the Range method gives the error whereas
passing two cells fixes the problem. I believe this is a bug in VSTO2005. Error: oRange = Globals.Sheet1.Range("A1") Works: oRange = Globals.Sheet1.Range("A1", "A1") The documentation contains an example that gives the same error until the fix above is applied: Dim textInCell As Microsoft.Office.Tools.Excel.NamedRange textInCell = Me.Controls.AddNamedRange( Me.Range("A1"), "cellText") should be: Me.Range("A1", "A1") "Jay Pondy" wrote: When placed in ThisWorkbook_StartUp the following code yields an HResult Exception: Dim oRange As Microsoft.Office.Interop.Excel.Range oRange = Globals.Sheet1.Range("$A$1") What am I doing wrong? (I will need the range object as a parameter for the Globals.Sheet1.Controls.AddListObject method.) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
The remote procedure call failed. (Exception from HRESULT: 0x80070 | Excel Worksheet Functions | |||
Exception from HRESULT: 0x800A03EC | New Users to Excel | |||
Exception from HRESULT: 0x800AC472 | Excel Discussion (Misc queries) | |||
Chart.Export throws COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC. | Excel Programming | |||
Exception HResult: 0x8007FA08 (VB.net) | Excel Programming |