PC Review


Reply
Thread Tools Rate Thread

Assigning an array to range object?

 
 
=?Utf-8?B?U21pdGNo?=
Guest
Posts: n/a
 
      16th Feb 2007
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

 
Reply With Quote
 
 
 
 
merjet
Guest
Posts: n/a
 
      16th Feb 2007
http://www.vb-helper.com/howto_net_declare_arrays.html

Hth,
Merjet


 
Reply With Quote
 
=?Utf-8?B?U21pdGNo?=
Guest
Posts: n/a
 
      16th Feb 2007
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


"merjet" wrote:

> http://www.vb-helper.com/howto_net_declare_arrays.html
>
> Hth,
> Merjet
>
>
>

 
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
Assigning a Range to a dynamic array Tommy Microsoft Excel Programming 1 20th Feb 2008 05:07 PM
assigning array back to range =?Utf-8?B?SmFuZQ==?= Microsoft Excel Programming 1 11th Nov 2004 07:45 AM
Assigning Range to Array =?Utf-8?B?U3RyYXR1c2Vy?= Microsoft Excel Programming 4 30th Oct 2004 06:23 AM
Assigning range to array not working Marston Microsoft Excel Programming 2 12th Aug 2004 11:38 PM
Assigning array to range inside Excel Object Bobsa Microsoft Excel Programming 5 1st Apr 2004 11:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:58 PM.