I like to make a script in AutoIT to work in Excel. when i trying to make a variable with the following argument is giving me error.
$myformula = "=IF(OR(ISNUMBER(search(" "&{"quality","st","rainbow","carryout","auto","surgery","public","fertiliser","Fertilisers","ifertilisersl","rendezvous","remember","that","precast","barefoot","mail","scaffolding","safe","access","salvation","army","funeral","directors","director","seahorse","simply","affordable","stich","time","dressmaking","alterations","hospital","by","jewellers","post","sweet","sensation","trophies","engraving","protection","produce","public","relations","made","fun","auctions","auction","kiltmakers","kiltmaker","linen","chippy","timber","tidy","tangles","past","dealer","trading","crafts","craft","naval","activities","US","Uncle","Diner","Removals","Volunteer","Zoo","Wavelength","Wavelengths","Friends","hairdressing","theatreclub","daynursery","MUSLC","superstore","colleges","AALCO","AARDVARK","ABACUS","ABB","ABBOTSWELL","ABBOTTPUBLIC","ABC","ABCON","ABDN","ABERCARE","ABERDEE","ABERDEEN","ABERDEENSHIRE","ABERFLORA","ABERGELDIE","ABERGLEN","ABERLOUR","ABERMED","ABERNE","ABERPEST","ABERSOL","ABERT","ABSCOT","ABSOFT","ABSPEK","ABSURE","ABTEX","ABTRUST","ACADEMY","ACCESS","ACCESSORIES","ACCOMMODATION","ACCORD","ACCOUNTANCY","ACCURAY","ACE","ACTION","ADAPT","ADEPT","ADMIN","ADMIRAL","ADS","ADULT","ADVANCE","ADVANCED","ADVANT","ADVANTAGE","ADVICE","AEA","AFFAIR","AFOS","AGA","AGE","AGENCY","AGIP","AGRI","AGRICULTURAL","AGRICULTURE","AHT","AI","AIDS","AIR","AIRBORNE","AIRFAIR","AIRLINES","AIRNAUTIC","AIRPAC","AIRPORT","AIRWAYS","AIRYHALL","AIRYLEA","AKRON","ALAD","ALASDAIR","ALB","ALBATECH","ALFA","ALL","ALLIANCE","ALLIED","ALLOMAX","ALPINE","ALSTEV","ALTERNATIVES","ALTRA","ALWAYS","ALZHEIMER","AM","AMALGAMATED","AMAT","AMATOLA","AMBER","AMEC","AMERICAN","AMETEK","AMIN","AMITEC","AMOCO","AMTECH","AMTRAK","AMUSEMENT","AND","ANDERGAUGE","ANIXTER","ANKA","ANTIQUES","ANTRIM","AOC","AP","APARDION","APEX","APOLLO","APOSTOLIC","APPEALS","APPLIED","APPOLLO","AQUA","AQUARISTS","AQUATEC","AQUATIC","AQUIDATA","ARCHITECTURAL","ARCO","ARGONAUT","ARGOSY","ARISTACUT","ARJO","ARJON","ARKAIG","ARTISTES","ARTISTS","ARTWORKS","ARUP","AS","ASA","ASCOT","ASDASUPERSTORES","ASHVALE","ASPECT","ASSEMBLIES","ASSESSORS","ASSOCIATED","ASSOCIATES","ASSOCIATION","ASSURANCE","ASTER","ASTRA","ATEL","ATHENA","ATHENAEUM","ATHOLL","ATLANTIC","AUCHMILL","AUCHTERLESS","AUGHTON","AUGUST","AUP","AUQUHARNEY","AURORA","AUTO","AUTOFIX","AUTOGLASS","AUTOMAGIC","AUTOQUICK","AUTOSAVE","AUTOSPRAY","AUTOTRUCK","AVCO","AVENUE","AWAKENING","AWAY","AXIOM","AZTEC","BAADER","BALNAGASK","BANKHEAD","BAR","BARICO","BARRIER","BARTERING","BASELINE","BATCHBRIGHT","BATH","BATHROOM","BAVARIA","BAYLISS","BAYLOR","BEARING","BEATTIES","BEAUTY","BEAVERBROOKS","BEECHWOOD","BEEFEATER","BEELINE","BEFRIEND","BENBOW","BESTWAY","BEWS","BIKES","BLIND","BLINDCRAFT","BLINDS","BLOOD","BLOOMING","BLOSSOMS","BLOW","BLUEBELLS","BMT","BNA","BOARD","BOARS","BOAT","BODY","BOHEMIA","BOILERMAKERS","BON","BONADDIO","BONAVENTURE","BONIVIEW","BONNYMUIR","BOOKBINDING","BOOTS","BOROWSKI","BORSALINO","BOSANQUET","BOSCH","BOTTLED","BOULEVARD","BOURTREE","BOWEN","BOWLING","BOWTECH","BOX","BP","BPCC","BRA","BRACKENRIDGE","BRAEHEAD","BRAESIDE","BRAKE","BRIEF","BRITANNIA","BRITANNIC","BROAD","BROADCAST","BROADSTRAIK","BROS","BROTHERHOOD","BRUNSWICK","BUCKSBURN","BUDGET","BUILDING","BULAWEYO","BUREAU","BURNTHILLS","BUS","BUSINESS","CABER","CABINS","CABLE","CABS","CAFE","CAIRD","CAIRNCRY","CAIRNGORM","CAKE","CALEDON","CALEDONIA","CALEDONIAN","CALLANDERS","CALOR","CALTEC","CALVARYTABERNACLEUNITED","CAMARGUE","CAMEO","CAMPAIGN","CAMPBELLS","CAMPHILL","CAMWATER","CAN","CANALE","CANCER","CANDO","CANSCO","CAPE","CARADON","CARD","CAREERS","CARGO","CARPET","CARPETS"}&" "," "&b1&" "))),"YES","NO")"
I tried with double quotes as well. What shall /i do?
Strings are enclosed in double-quotes like "this". If you want a string to actually contain a double-quote use it twice like:
"here is a ""double-quote"" - ok?"
You can also use single-quotes like 'this' and 'here is a ' 'single-quote' ' - ok?'
You can mix quote types to make for easier working and to avoid having to double-up your quotes to get what you want. For example if you want to use a lot of double-quotes in your strings then you should use single-quotes for declaring them:
'This "sentence" contains "lots" of "double-quotes" does it not?'
is much simpler than:
"This ""sentence"" contains ""lots"" of ""double-quotes"" does it not?"
Just use ' instead of ".
Like this:
$myformula = '=IF(OR(ISNUMBER(search(" "&{"quality","st","rainbow","carryout","auto","surgery","public","fertiliser","Fertilisers","ifertilisersl","rendezvous","remember","that","precast","barefoot","mail","scaffolding","safe","access","salvation","army","funeral","directors","director","seahorse","simply","affordable","stich","time","dressmaking","alterations","hospital","by","jewellers","post","sweet","sensation","trophies","engraving","protection","produce","public","relations","made","fun","auctions","auction","kiltmakers","kiltmaker","linen","chippy","timber","tidy","tangles","past","dealer","trading","crafts","craft","naval","activities","US","Uncle","Diner","Removals","Volunteer","Zoo","Wavelength","Wavelengths","Friends","hairdressing","theatreclub","daynursery","MUSLC","superstore","colleges","AALCO","AARDVARK","ABACUS","ABB","ABBOTSWELL","ABBOTTPUBLIC","ABC","ABCON","ABDN","ABERCARE","ABERDEE","ABERDEEN","ABERDEENSHIRE","ABERFLORA","ABERGELDIE","ABERGLEN","ABERLOUR","ABERMED","ABERNE","ABERPEST","ABERSOL","ABERT","ABSCOT","ABSOFT","ABSPEK","ABSURE","ABTEX","ABTRUST","ACADEMY","ACCESS","ACCESSORIES","ACCOMMODATION","ACCORD","ACCOUNTANCY","ACCURAY","ACE","ACTION","ADAPT","ADEPT","ADMIN","ADMIRAL","ADS","ADULT","ADVANCE","ADVANCED","ADVANT","ADVANTAGE","ADVICE","AEA","AFFAIR","AFOS","AGA","AGE","AGENCY","AGIP","AGRI","AGRICULTURAL","AGRICULTURE","AHT","AI","AIDS","AIR","AIRBORNE","AIRFAIR","AIRLINES","AIRNAUTIC","AIRPAC","AIRPORT","AIRWAYS","AIRYHALL","AIRYLEA","AKRON","ALAD","ALASDAIR","ALB","ALBATECH","ALFA","ALL","ALLIANCE","ALLIED","ALLOMAX","ALPINE","ALSTEV","ALTERNATIVES","ALTRA","ALWAYS","ALZHEIMER","AM","AMALGAMATED","AMAT","AMATOLA","AMBER","AMEC","AMERICAN","AMETEK","AMIN","AMITEC","AMOCO","AMTECH","AMTRAK","AMUSEMENT","AND","ANDERGAUGE","ANIXTER","ANKA","ANTIQUES","ANTRIM","AOC","AP","APARDION","APEX","APOLLO","APOSTOLIC","APPEALS","APPLIED","APPOLLO","AQUA","AQUARISTS","AQUATEC","AQUATIC","AQUIDATA","ARCHITECTURAL","ARCO","ARGONAUT","ARGOSY","ARISTACUT","ARJO","ARJON","ARKAIG","ARTISTES","ARTISTS","ARTWORKS","ARUP","AS","ASA","ASCOT","ASDASUPERSTORES","ASHVALE","ASPECT","ASSEMBLIES","ASSESSORS","ASSOCIATED","ASSOCIATES","ASSOCIATION","ASSURANCE","ASTER","ASTRA","ATEL","ATHENA","ATHENAEUM","ATHOLL","ATLANTIC","AUCHMILL","AUCHTERLESS","AUGHTON","AUGUST","AUP","AUQUHARNEY","AURORA","AUTO","AUTOFIX","AUTOGLASS","AUTOMAGIC","AUTOQUICK","AUTOSAVE","AUTOSPRAY","AUTOTRUCK","AVCO","AVENUE","AWAKENING","AWAY","AXIOM","AZTEC","BAADER","BALNAGASK","BANKHEAD","BAR","BARICO","BARRIER","BARTERING","BASELINE","BATCHBRIGHT","BATH","BATHROOM","BAVARIA","BAYLISS","BAYLOR","BEARING","BEATTIES","BEAUTY","BEAVERBROOKS","BEECHWOOD","BEEFEATER","BEELINE","BEFRIEND","BENBOW","BESTWAY","BEWS","BIKES","BLIND","BLINDCRAFT","BLINDS","BLOOD","BLOOMING","BLOSSOMS","BLOW","BLUEBELLS","BMT","BNA","BOARD","BOARS","BOAT","BODY","BOHEMIA","BOILERMAKERS","BON","BONADDIO","BONAVENTURE","BONIVIEW","BONNYMUIR","BOOKBINDING","BOOTS","BOROWSKI","BORSALINO","BOSANQUET","BOSCH","BOTTLED","BOULEVARD","BOURTREE","BOWEN","BOWLING","BOWTECH","BOX","BP","BPCC","BRA","BRACKENRIDGE","BRAEHEAD","BRAESIDE","BRAKE","BRIEF","BRITANNIA","BRITANNIC","BROAD","BROADCAST","BROADSTRAIK","BROS","BROTHERHOOD","BRUNSWICK","BUCKSBURN","BUDGET","BUILDING","BULAWEYO","BUREAU","BURNTHILLS","BUS","BUSINESS","CABER","CABINS","CABLE","CABS","CAFE","CAIRD","CAIRNCRY","CAIRNGORM","CAKE","CALEDON","CALEDONIA","CALEDONIAN","CALLANDERS","CALOR","CALTEC","CALVARYTABERNACLEUNITED","CAMARGUE","CAMEO","CAMPAIGN","CAMPBELLS","CAMPHILL","CAMWATER","CAN","CANALE","CANCER","CANDO","CANSCO","CAPE","CARADON","CARD","CAREERS","CARGO","CARPET","CARPETS"}&" "," "&b1&" "))),"YES","NO")'
You have a lot of quotes in there. Try rewriting it adding just one string at a time...once you get it working, then you can start adding more than one string at a time.