meatsack Posted February 16, 2010 Posted February 16, 2010 Perplexed by why the $sCellValue variable is failing to store any data. I tried numbers and text. I double checked my test.xls file to make sure it had data. Is Excel security blocking the script for getting in? I am using msgbox for debugging purposes. I would delete it in the scripts final version. Thanks for any help. ; ;################################## ; Include ;################################## #Include<file.au3> #include <Excel.au3> #include <Array.au3> ;################################## ; Variables ;################################## $sFilePath1 = @ScriptDir & "c:\test.xls" ;This file should already exist $oExcel = _ExcelBookOpen($sFilePath1) _ExcelWriteCell($oExcel, "I Wrote to This Cell", 1, 1) ;Write to the Cell $sCellValue = _ExcelReadCell($oExcel, 1, 1) MsgBox(0, "", "The Cell Value is: " & @CRLF & $sCellValue, 2)
enaiman Posted February 16, 2010 Posted February 16, 2010 $sFilePath1 = @ScriptDir & "c:\test.xls" What would be the value of this variable ??? 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 :)
meatsack Posted February 16, 2010 Author Posted February 16, 2010 (edited) $sFilePath1 "c:\test.xls"@ScriptDir = Directory containing the running script. (Result does not contain a trailing backslash) I don't know, I will guess that this is where my script or my AutoIt.exe is located. I don't even know if @ScriptDir is a variable.I am certain $sCellValue is a variable. And this variable should have a value, if not something is wrong such as its not declared, its data needs to be set to zero before using it in the script or sumtin. Edited February 16, 2010 by meatsack
Beege Posted February 16, 2010 Posted February 16, 2010 (edited) @scriptdir is the current directory your script is in. So if the path is wrong your file never gets open and no data gets put into $sCellValue. filepath needs to be: $sFilePath1 = @ScriptDir & "\test.xls" Edited February 16, 2010 by Beege Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator
enaiman Posted February 16, 2010 Posted February 16, 2010 You didn't bother to use a message box to see the value for the variable??? I wonder why I'm still helping you ... 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 :)
meatsack Posted February 16, 2010 Author Posted February 16, 2010 I wonder why I'm still helping you ... Whoops my bad. Works perfectly now. @scriptdir is the current directory your script is in. So if the path is wrong your file never gets open and no data gets put into $sCellValue. filepath needs to be: $sFilePath1 = @ScriptDir & "\test.xls" Thank you. I should have msgboxed the @ScriptDir variable. I didn't even know it was a variable. I'll try msgbox everything before I use the forum.
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