randallc Posted September 14, 2005 Posted September 14, 2005 (edited) Hi,Here shows how you can write any excel formula in a cell with ExcelCom, and return an answer.[needs version 1_2_3 for new close and exit commands]#include<ExcelCom.au3>;needs version 1_2_3 for new close and exit commands$FilePath=@ScriptDir&"\book1.xls"If Not FileExists($FilePath) Or Not StringInStr($FilePath, "xls") Then $FilePath = FileOpenDialog("Go - Choose your excel file as inbuilt one not exists", $FilePath, "Worksheet" & " (" & "*.xls" & ")", 1)EndIf$Formula1="=roman(2005,1)"$var1=_XLwrite($FilePath,3,"A",1,$Formula1)$Formula2="=fact(12)"$var2=_XLwrite($FilePath,3,"A",1,$Formula2)$Formula3="=sin(radians(30))"$var3=_XLwrite($FilePath,3,"A",1,$Formula3)$Formula4="=power(2005,-1.3)"$var4=_XLwrite($FilePath,3,"A",1,$Formula4)$Formula5="=power(2005,1/3)"$var5=_XLwrite($FilePath,3,"A",1,$Formula5)_XLclose($FilePath,0); no changes and close workboot; not Excelmsgbox (0,"_XLformula=", $Formula1&"="&$var1&@CRLF&$Formula2&"="&@tab&$var2&@CRLF&$Formula3&"="&@tab&$var3&@CRLF&$Formula4&"="&@tab&$var4&@CRLF&$Formula5&"="&@tab&$var5)_XLread($FilePath,3,"A",1)_XLexit($FilePath,0)Best, Randall Edited September 14, 2005 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now