Can't create a new instance of the Range class

D

deltaquattro

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top