VB to Excel Export String Array Issue

  • 12 years ago

    Hi All

    I am a newbie on here and fairly new to programming (I am mainly teaching myself) so please forgive me if the answer to this is obvious.

     I have a dynamic array of strings that I have enlarged and filled with data by making the program read a log file and split as necessary. I know that this array is filling correctly because if I use a "For next" loop to output the data into excel it works as it should. However - I am now trying to speed things up and streamline the code by making it export the whole array to a colour of cells in one go - I discovered the tip on the Microsoft site, the tip said to use the code shown below:-

    oSheet.Range("A2").Resize(QtyOfSongsUsed, 1).Value = HowUsedOutput1

    The problem is this - it will select and fill the correct qty of cells but it fills them with whatever the first item in the array is not each item one after another. it does not bring up any errors and appears to work seamlessly until you open the excel sheet and see the result.

    I can't see anything wrong - but then I am a newbie so any advice would be appreciated.

    Thank you

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“An expert is a man who has made all the mistakes that can be made in a very narrow field” - Niels Bohr