SkysLastChance Posted March 22, 2022 Posted March 22, 2022 I have been trying to figure this out longer then I would like to admit. I am betting that I am missing something super simple. #include <Excel.au3> Local $oExcel = _Excel_Open() Local $oWorkbook = _Excel_BookNew($oExcel) $vPath = "'J:\Temporary Files\FolderName\FileName.xlsx''!$A:$B,2,0))'" _Excel_RangeWrite($oWorkBook, Default, '=IF(D2=D1,"",VLOOKUP(D2,''J:\Temporary Files\FolderName\FileName.xlsx''!$A:$B,2,0))', "A1", False) ;Line 1 _Excel_RangeWrite($oWorkBook, Default, '=IF(D2=D1,"",VLOOKUP(D2,' & $vPath, "A2", False) ;Line 2 ConsoleWrite("'=IF(D2=D1,"",VLOOKUP(D2,''J:\Temporary Files\FolderName\FileName.xlsx''!$A:$B,2,0))'" & @CRLF) ConsoleWrite("'=IF(D2=D1,"",VLOOKUP(D2,'" & $vPath & @CRLF) Why is line 1 writing but line 2 is not? Any suggestion to lead me in the right direction is appreciated. You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott
Solution SkysLastChance Posted March 22, 2022 Author Solution Posted March 22, 2022 Figured it out. #include <Excel.au3> Local $oExcel = _Excel_Open() Local $oWorkbook = _Excel_BookNew($oExcel) $vPath = "'J:\Temporary Files\FolderName\FileName.xlsx'!$A:$B,2,0))" _Excel_RangeWrite($oWorkBook, Default, '=IF(D2=D1,"",VLOOKUP(D2,''J:\Temporary Files\FolderName\FileName.xlsx''!$A:$B,2,0))', "A3", False) ;Line 1 _Excel_RangeWrite($oWorkBook, Default, '=IF(D2=D1,"",VLOOKUP(D2,' & $vPath, "A4", False) ;Line 2 You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott
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