LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default problem:Structure with Object reference (TYPE...END TYPE)

I keep getting the dreaded "Runtime Error '91'....
Object Variable or With-block variable not set"

Type RangeTestType
TestCount As Long ' Cell Count
TestRange As Object ' Range RefString variable stores a name.
End Type
Dim retval as RangeTestType
Dim dataRange As Range
Dim lCellcnt As Long
Dim x as Object

Set dataRange = Range("A1:" & "C" & ActiveSheet.Rows.Count)
x = dataRange
lCellcnt = dataRange.Cells.Count
retval.TestCount = lCellcnt
retval.TestRange = x <= THIS STATEMENT TRIGGERS ERROR

When I replace the Object with "Range", I get the exact same error.
Somehow, passing objects within a structure appear to be
problematic....
any help greatly appreciated. (Excel 2003)

 
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
object on RHS when there is a type-mismatch [email protected] Excel Programming 0 October 12th 06 02:00 AM
Help: Compile error: type mismatch: array or user defined type expected lvcha.gouqizi Excel Programming 1 October 31st 05 08:20 PM
On-the-fly determination of object type? Ed Excel Programming 2 May 17th 05 08:37 PM
automation object type library reference Kevan Hanson Excel Programming 2 August 4th 04 02:29 AM
User Defined Type Structure - want it to be variable not numeric literal WyoCracker Excel Programming 1 July 21st 03 09:28 PM


All times are GMT +1. The time now is 10:09 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"