LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default How does one create a delete property of a user defined class?

That helps Jim. Thanks!
-Abe

Jim Thomlinson wrote:
It is the same general idea as instantiating a word object. Setting the
instance to nothing does not close the application. Unless told to close it
does not close. Same idea here. You did not tell the range object to clear.
You just removed your pointer to that object. The range and the picture exist
on their own. The destructor runs on the object when you set it to nothing.
You have to do the housekeeping in the destructor (terminate) before loosing
your link to the object. It is sort of analagous to the housekeeping that you
have to do in C++ or Java when you destroy objects. In VB we are spoiled
because usually VB does the housekeeping for us (except in the case of
objects).
--
HTH...

Jim Thomlinson


" wrote:

Thanks Tim, creating the clear method worked... though im not sure why
setting the object to nothing wouldn't delete the picture...

-Abe

Tim Williams wrote:
Create a method in your class called (eg) "Clear" which clears the cell and deletes the picture.
After calling that just set the class instance to Nothing.

Or put some code in the class_terminate event, which should get called when you set an instance to Nothing (but I'm not absolutely
sure about scope etc in this case, so you should test that thoroughly)


--
Tim Williams
Palo Alto, CA


wrote in message oups.com...
I have a class that I made, called clsPicCell. Each clsPicCell object
has a two objects within it, a range object and a picture object (both
private objects).

I would like help on how to be able to delete a clsPicCell object, call
it xCell. The desired result is that if I code something like:

xCell.delete

it will clear the range object and delete the picture, and get rid of
the object all together. How would I do this? I was unable to find any
related topics, so point me in the direction of one if you know of it.

Thanks,

-Abe




 
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
Cant delete user defined default chart type jenalee Charts and Charting in Excel 7 August 21st 09 08:00 PM
How do I delete a User defined default excel chart Jai Charts and Charting in Excel 1 November 7th 07 09:32 AM
Delete user-defined charts Lampman Charts and Charting in Excel 2 January 24th 07 01:49 AM
User-defined type collection in class module Rob[_29_] Excel Programming 2 May 31st 06 06:02 PM
Create my own Class Object for Ranges, having trouble assigning name property [email protected] Excel Programming 4 November 29th 05 06:08 PM


All times are GMT +1. The time now is 07:14 AM.

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"