Assigning an array to range object?

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
 
G

Guest

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
 

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