Varaibles on Variables with Excel

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Novalak
Newbie
Posts: 9
Joined: Sun Dec 07, 2014 10:23 am

Varaibles on Variables with Excel

Post by Novalak » Sun Dec 07, 2014 10:32 am

Im having troubles calling a variable within a variable
for instance, i look through some code with excel - once it hits a row which meets, i grab the line

For example

Input>Sheet,Sheet?,Sheet1
Let>Excel=C:\Upload\Test.xls
XLSheetToArray>%Excel%,%Sheet1%,xlData
<LOOP CODE>
Let>URL=xlData_%count%_3
SMTPSendMail><email>,<server>,<from>,<name>,<Subject>,%URL%,

So basically lets say row 100 meets the condition, the URL variable should get populated with the contents of xlData_100_3
Instead, URL becomes xlData_100_3 which then my mail makes no sense


What am i missing here?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Varaibles on Variables with Excel

Post by Marcus Tettmar » Sun Dec 07, 2014 12:40 pm

What do you see in the watch list after the XLSheetToArray call. You should see the xlData array variable in the watch list. If you double click that you'll see the values. Is xlData_100_3 showing there?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Novalak
Newbie
Posts: 9
Joined: Sun Dec 07, 2014 10:23 am

Re: Varaibles on Variables with Excel

Post by Novalak » Sun Dec 07, 2014 11:12 pm

Its working

it doesnt work when i put this in the data
SMTPSendMail><email>,<server>,<from>,<name>,<Subject>,xlData_%count%_3,

but works if i name the variable first

Let>URL=xlData_%count%_3
SMTPSendMail><email>,<server>,<from>,<name>,<Subject>,%URL%,

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Varaibles on Variables with Excel

Post by Marcus Tettmar » Mon Dec 08, 2014 9:03 am

Yes, that's expected.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts