PC Review


Reply
Thread Tools Rate Thread

Can't create a new instance of the Range class

 
 
deltaquattro
Guest
Posts: n/a
 
      3rd Dec 2010
Hi all,

why is the following is invalid code?

Sub foo()

Dim MyRange As Range
Set MyRange = New Range

End Sub

The New statement works with a class defined in a Class Module, but it
looks like it doesn't work with classes in the Excel Object Model. Is
there any workaround for this? Thanks,

Best Regards

Sergio Rossi
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamically create class instance from class name Scott Izu Microsoft C# .NET 1 7th Oct 2008 03:20 PM
how to create class instance? André Microsoft VB .NET 4 15th Mar 2007 05:20 PM
How to create an instance of a vb.net class from vc++ S Wheeler Microsoft VC .NET 9 29th Jan 2006 07:47 PM
How to have New() in a Base Class create and return an instance of a Derived Class? Joe HM Microsoft VB .NET 4 22nd Nov 2005 09:31 PM
Activator could not create a instance of the class as the Length of the class name is 36 characters Jack Wright Microsoft C# .NET 0 18th Mar 2004 04:21 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:13 AM.