LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
rci rci is offline
external usenet poster
 
Posts: 40
Default Re referencing an object

Hi all... a newbie question...

I would like to, in a function, create an object, then do things to it.

ex: Dim SpreadSheet1 As OWC10.Spreadsheet
Set SpreadSheet1 = CreateObject("OWC10.Spreadsheet")

and then play around with SpreadSheet1 as needed.

But what about when I re-enter the function? I don't want to create a new
object... I want to simply reference the object that was created earlier!


What is the proper programming methodology to handle this?

I could move the object creation outside of the function... but would it
then exist within the context of the function? How do I discover, from
within the fucntion, if the object already exists... and then to reference
it? Do I somehow pass the object, or some reference/pointer to the object
to the function is some way?

Thanks for helping a newbie...

MP
 
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
2 Label Options - Forms Object vs Control Box Object Awrex Excel Discussion (Misc queries) 3 July 17th 09 07:10 PM
Object Variable Not Set Error on Selection object Jean Excel Worksheet Functions 3 July 24th 06 06:45 PM
Referencing worksheet CODENAME in a chart object. Bing Excel Discussion (Misc queries) 1 February 15th 05 01:01 AM
Referencing a ComboBox control from a Workbook Object? debartsa Excel Programming 3 December 9th 03 08:43 PM
Range object to Array object conversion Tom Ogilvy Excel Programming 0 August 1st 03 12:16 AM


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