Results 1 to 10 of 10

setting an object's property to an object

Threaded View

  1. #1
    Forum Contributor
    Join Date
    02-13-2016
    Location
    CT USA
    MS-Off Ver
    office 365 subscription
    Posts
    181

    setting an object's property to an object

    WHEN SETTING AN OBJECT'S PROPERTY TO AN OBJECT
    runtime code fails to work, but no compiler error.

    Here is the code that correctly reads the cells of a worksheet
    and successfully places the values into an object (verified via debugger)

    FieldDataCoordinates.X = Ptr2FDWrkSht.Cells(Row, X_CoordinateColumn).value
    FieldDataCoordinates.Y = Ptr2FDWrkSht.Cells(Row, Y_CoordinateColumn).value

    Here is the line of code that seeks to place the above object,FieldDataCoordinates,
    into an object,Ptr2FieldData,

    Ptr2FieldData.Coordinates = FieldDataCoordinates
    The above line executes. I can single step it through the "let" code in the Ptr2FieldData object:

    Public Property Let Coordinates(value As CoordinatesClass)
        Set PMeasurementCoordinates = value
    End Property

    When the above read code completes execution, the debugger
    reveals the CoordinatesObj DID make it into the private storage of
    the Coordinates property

    but the debugger gives me the impression that it is not there by
    indicating the public property of Ptr2FieldData.Coordinates does not exist
    "object variable....not set"

    Soooo....the code for reading the private data out must be at fault. I used "set" to define PMeasurementCoordinates.....do i have to something analogous in removing Coordinates?

    Public Property Get Coordinates() As CoordinatesClass
        set Coordinates = PMeasurementCoordinates
    End Property
    What does that debugger error message mean? the code did execute.
    Last edited by whburling; 05-30-2017 at 05:48 PM. Reason: learned additional info

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. I am having a problem setting an object property which is itself an object
    By whburling in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-29-2017, 03:39 PM
  2. Object Does not support property
    By Biplab1985 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-18-2016, 05:28 PM
  3. Replies: 0
    Last Post: 06-19-2014, 02:09 PM
  4. How do you use the Name property of the Range object?
    By Excel_vba in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-15-2013, 07:42 PM
  5. Values property of the Borders Object
    By Excel_vba in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2013, 10:15 PM
  6. Using the Parent property of the Borders Object
    By Excel_vba in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2013, 09:53 PM
  7. Using The Value property of the ActiveCell object
    By Almamba in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-21-2005, 02:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1