wimhek Posted May 29, 2010 Share Posted May 29, 2010 Hi I am using the ExcelCom_UDF, where I read data from an excel sheet. I cannot get the result of a formula. Is there a way to fetch this ? . Link to comment Share on other sites More sharing options...
taietel Posted May 29, 2010 Share Posted May 29, 2010 Try this: #Include <Excel.au3> $oExcel = _ExcelBookOpen(@ScriptDir & "\grafic.xls", 0);file not visible $sCellValue = _ExcelReadCell($oExcel, 4, 3);row 4, col 3 (C4) MsgBox(0, "", "The Cell Value is: " & @CRLF & $sCellValue, 2) _ExcelBookClose($oExcel) Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
wimhek Posted May 29, 2010 Author Share Posted May 29, 2010 I still got an empty result. For your info, the cell contains : =NETWORKDAYS(NOW();L7) (L7 contains 30-04-2010) Link to comment Share on other sites More sharing options...
Tvern Posted May 29, 2010 Share Posted May 29, 2010 The above works for me. It returns -21. Did you point _ExcelReadCell to the correct cell? (I did have to add $oExcel.Quit to properly close Excel though, but that's another issue) Link to comment Share on other sites More sharing options...
wimhek Posted May 29, 2010 Author Share Posted May 29, 2010 The above works for me. It returns -21.Did you point _ExcelReadCell to the correct cell?(I did have to add $oExcel.Quit to properly close Excel though, but that's another issue)Hmm maybe I am using the wrong UDF versionIf I change the cell in 'normal data', I see the content. Link to comment Share on other sites More sharing options...
sdfg4545 Posted October 12, 2010 Share Posted October 12, 2010 WIMHEK....HELP!I have the opposite problem. When I read a cell, I get the value, I want the formula.How do I get the formula? How did you get it?HenryHiI am using the ExcelCom_UDF, where I read data from an excel sheet. I cannot get the result of a formula. Is there a way to fetch this ?. Link to comment Share on other sites More sharing options...
Tvern Posted October 12, 2010 Share Posted October 12, 2010 Try $sFormula = $oExcel.Activesheet.Range("A1").Formula Link to comment Share on other sites More sharing options...
sdfg4545 Posted October 12, 2010 Share Posted October 12, 2010 How can I find more information about working with Excel this way: $oExcel.Activesheet.Range("A1").Formula That will work for me. I also want to do more... Link to comment Share on other sites More sharing options...
Tvern Posted October 12, 2010 Share Posted October 12, 2010 It makes use of the COM interface of excel. MSDN has lots of information on it. Link to comment Share on other sites More sharing options...
JoHanatCent Posted October 13, 2010 Share Posted October 13, 2010 Try taietel's solution in post #2. Your formula seems to be at fault? ";" should be a "," Link to comment Share on other sites More sharing options...
Tvern Posted October 13, 2010 Share Posted October 13, 2010 Try taietel's solution in post #2.Your formula seems to be at fault? ";" should be a ","I don't think so.Using dutch excel "=NETTO.WERKDAGEN(NU();L7)" works, while "=NETTO.WERKDAGEN(NU(),L7)" tells me there is an error in my formula. Link to comment Share on other sites More sharing options...
JoHanatCent Posted October 13, 2010 Share Posted October 13, 2010 I don't think so.Using dutch excel "=NETTO.WERKDAGEN(NU();L7)" works, while "=NETTO.WERKDAGEN(NU(),L7)" tells me there is an error in my formula.See attached from the help screen. Wonder if it would be a language thing? Link to comment Share on other sites More sharing options...
JoHanatCent Posted October 13, 2010 Share Posted October 13, 2010 I did a test and getting the correct answer. #Include <Excel.au3> $oExcel = _ExcelBookOpen(@desktopdir & "\test.xls", 0);file not visible $sCellValue = _ExcelReadCell($oExcel, 4, 3);row 4, col 3 (C4) MsgBox(0, "", "The Cell Value is: " & @CRLF & $sCellValue, 2) _ExcelBookClose($oExcel) Link to comment Share on other sites More sharing options...
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