Jump to content
Sign in to follow this  

Newbie Question about Send command

Recommended Posts


Hey everyone. I am trying to write a command to enter a formula into excel and have it contain a variable within it. Now since i'm new to AutoIt i may be doing this a very drawn out way but nonetheless it sort of works.

This is my code:



While $var1 < 10






The part where $var1 is is where i want to enter the variable but i keep getting an error. Could someone help me with the syntax?


Share this post

Link to post
Share on other sites

It should be:

Send("=6371.1*((2*ASIN(SQRT((SIN((RADIANS(Data!C" & $var1 & ")-RADIANS(Data!F2))/2)^2)+COS(RADIANS(Data!C" & $var1 & "))*COS(RADIANS(Data!F2))*(SIN((RADIANS(Data!B" & $var1 & ")-RADIANS(Data!G2))/2)^2)))))*1000)")

If you need those double quotes to be part of the formula, it would be:

Send('=6371.1*((2*ASIN(SQRT((SIN((RADIANS(Data!C"' & $var1 & '")-RADIANS(Data!F2))/2)^2)+COS(RADIANS(Data!C"' & $var1 & '"))*COS(RADIANS(Data!F2))*(SIN((RADIANS(Data!B"' & $var1 & '")-RADIANS(Data!G2))/2)^2)))))*1000)')
Edited by omikron48

Share this post

Link to post
Share on other sites

You keep forgetting the & - that's why you get the error.


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this