Type mismatch for array variable in vbs when using split to define it

I keep getting a type mismatch error with this script for the array variable (websitearray) I'm trying to create from splitting the long text string:

dim websites
dim websitearray
Dim i
Dim domain

websites = "adamphotogallery.com addisongeary.com ambermckenzie.com amyherr.com amysphotographix.com annelizabethschlegel.com apiphotography.com arondaphotography.com ashoksinha.com avianstock.com bernicesnyder.com bigblackbag.com bigblackbag.net bigskylivingstonweddings.com bonvivantcinema.com breshearsphoto.com carolbethicard.com carolyncarr.com chrishiers.com colortecllc.com danbenner.com dancrawford.com dandelouise.com danielmartinezphoto.com daunesheriartstudio.com deanimages.com dennis-sagwitz.com dewdropphotography.com dickmanportfolio.com dillingerkovach.com dm7studios.com dmooreartist.com doughopfer.com drewcallaghanphotography.com eajphoto.com ellenrosenthal.com encamera.com figmentsphotography.com figmentsphotography.com.au fireflyfoto.net fleischmanphoto.com foxreps.com freedomphotos.net fusionphotography.biz gabrielvaningen.com griffithphotography.com growth2.net hollyhodson.com inspiredfirstbrand.com ion-photography.com jadepegler.net jamesejohnson.com janetbartlettgoodman.com janetlynnphotography.com jeffseltzerphotography.com jenmayphotography.com johnjonasweb.com jonathanbroadbent.com julianhaber.com katarinablazevic.com katemccoy.net kaythorogoodphotography.com kemperimagery.com kenkwok.com kgfineart.com kortduce.com lasalaphotos.com laurajohansen.com liakassart.com lostcoaststudio.com louisanastas.com lyndontravers.com marcialeeder.com marginadennis.com markandreani-fashion-photography.com markandreani.com marksandersonphoto.net martyjonas.com mcdonald-media.com mdmphotostudio.com midjo-pasto-gallery.com mikebullimages.com misha-mccrary.com mwestermeier.com nathansmithphoto.com nbimages.net nicolebrunsonphotography.com nitawinterandrobbadgerphotography.com oshun-jewelry.com pamlottphotoillustration.com patricklinehan.com photographertoronto.ca photosbywally.com pixlitter.com polecatmedia.com powerlunchproduction.com prismaproductions.com raeoflightphotography.com rboephoto.com robinsoneditions.com robkarosis.com robpena.com ronaldserfassartist.com rose-photography.com rossstockwellphotography.com rpughphoto.com samanthabender.com samdamico.com sealpointdesigns.com shellycastellano.com shrimptoncouture.com shrimptoncouture2.com simonrickerty.com simonryder.co.uk sl4design.com sofiaharrison.com spotstok.org steffanhacker.com stellarfilms.net stevenstills.com steveryanart.com stevetruongphotography.com tamarakay.com theartofthecurve.com thedalyblog.com thereseflanagan.com thestudioofphotography.com thomasbollinger.com thomaskosaphotography.com tpquigley.com tsirrell.com upstairsartspace.org venividiphoto.com wooddellstudio.com worksonpaper.biz yellowstonephotos.net yes.on.ca yourdreamimages.com"

websitearray = split(websites," ")

For i = 0 to ubound(websitearrray)

SUB changethedns ( domain )
WScript.Echo domain

I have tried declaring like so:
dim websitearray()

but this fails as well.

Can you tell me why?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi Julian,

The split works well by itself, it could be because there is an extra 'r' in 'websitearray' in the line:
For i = 0 to ubound(websitearrray)

Changing that gets your above code to work fine. I'm not sure if it was a typo while posting, if so then I'm guessing your actual changethedns sub could be different than just a wscript.echo


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
juliandormonAuthor Commented:
Doh! damn typos. Thanks a lot
I do it all the time :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.