Assigning an array to range object?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

This seems like a silly question but I can’t seem to find the answer…

In VBA I can do this
Dim wks As Worksheet
Dim rng As Range

Set wks = ThisWorkbook.ActiveSheet
Set rng = wks.Range("A1").Resize(1, 5)
rng = Array("One", "Two", "Three", "Four", "Five")

How do I do the same in VB.NET (2005)?

Thank you,

~Smitch
 
Thank you for the response… I should rephrase my question:

When in VB.NET using the Interop libraries how do you get the
Range = Array assignment to work.

I always get an cast exception. I have tried straight array as well as
object array.

Thank you,
~Smitch
 
Back
Top