Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
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
The remote procedure call failed. (Exception from HRESULT: 0x80070 Avinash [email protected] Excel Worksheet Functions 0 December 22nd 08 12:20 PM
Exception from HRESULT: 0x800A03EC nano2k New Users to Excel 0 July 21st 06 12:15 PM
Exception from HRESULT: 0x800AC472 [email protected] Excel Discussion (Misc queries) 0 May 30th 06 09:01 PM
Chart.Export throws COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC. Steven Excel Programming 1 November 5th 03 06:59 PM
Exception HResult: 0x8007FA08 (VB.net) prashanth Kotha Excel Programming 0 August 20th 03 07:27 PM


All times are GMT +1. The time now is 12:51 AM.

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

About Us

"It's about Microsoft Excel"