Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User Defined Object help fast


I have a template that users use to create a few different worksheets
from. I have an object, that I want to be available throughout the
life of the worksheet. Then each time the worksheet opens, it will
create a new object that is there until the user closes the worksheet.

The problem appears to be that when the new worksheet gets created, and
is saved, the object that was created while still in the template gets
reset so it is no longer instanciated.

I have a module that defines the object in the global area: Public
oMSR As clsMSR

Then in a sub routine in the module: Set oMSR = New clsMSR

Am I right in thinking that the object is reset after it is saved as a
new name?
I have tried resetting it after the document is saved, but I still
cannot get the object to be instanciated.

I always get a Run-Time Error '91': Object variable or With Block
variable not set.

How should I reference the variable throughout all my modules?

just oMSR.whatevermethod or
moduletheglobalvariableisdefined.oMSR.method

Thanks


--
reddog9069
------------------------------------------------------------------------
reddog9069's Profile: http://www.excelforum.com/member.php...o&userid=24458
View this thread: http://www.excelforum.com/showthread...hreadid=390575

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
Run-time error '50290': Application-defined or object-defined erro Macro button Excel Discussion (Misc queries) 1 March 12th 09 10:59 AM
Application-Defined or Object-Defined Error on simple code Fid[_2_] Excel Programming 1 July 21st 05 08:30 PM
Application-Defined or Object-Defined Error on simple code [email protected] Excel Programming 6 February 22nd 05 09:03 PM
Application-defined or object-defined error - missing the basics [email protected] Excel Programming 1 December 28th 04 10:23 PM
User-defined data type; Error: Only User-defined types... tiger_PRM Excel Programming 1 July 18th 04 03:32 PM


All times are GMT +1. The time now is 05:16 PM.

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"