Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to define large list of strings in Visual Basic

Tags:

powerpoint

vba

I'm writing a macro in Visual Basic for PowerPoint 2010. I'd like to initialize a really big list of strings like:

big_ol_array = Array( _
"string1", _
"string2", _
"string3", _
"string4" , _
  .....
"string9999" _
)

...but I get the "Too many line continuations" error in the editor. When I try to just initialize the big array with no line breaks, the VB editor can't handle such a long line (1000+) characters.

Does anyone know a good way to initialize a huge list of strings in VB?

Thanks in advance!

like image 275
HotDogCannon Avatar asked May 26 '14 19:05

HotDogCannon


1 Answers

I don't think there's a way to do what you want. But there exist some workarounds.

For example, you could load your list of strings from a file. That example can show you a hint :

Dim value As String = File.ReadAllText("C:\file.txt")

Also, this page talks about it : Excel macros - Too many line continuations.

like image 112
Freelex Avatar answered Sep 26 '22 13:09

Freelex