l3ill Posted March 30, 2010 Posted March 30, 2010 Hi, can any body tell me why I cant save a file with these settings: #include <Excel.au3> #include <Date.au3> #include <DateTimeConstants.au3> Local $iBatch = String(@MDAY & @MON & @YEAR & @YDAY) $sFilePath1 = @ScriptDir & "\Test1.xls" ;This file should already exist $oExcel = _ExcelBookOpen($sFilePath1) If @error = 1 Then MsgBox(0, "Error!", "Unable to Create the Excel Object") Exit ElseIf @error = 2 Then MsgBox(0, "Error!", "File does not exist - Shame on you!") Exit EndIf _ExcelBookSaveAs($oExcel, @DesktopDir & $iBatch, "xls") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iBatch = ' & $iBatch & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console If Not @error Then MsgBox(0, "Success", "File was Saved!", 3) _ExcelBookClose($oExcel, 1, 0) ;This method will save then Close the file, without any of the normal prompts, regardless of changes The script announces success w/out error...but no file is saved. My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
JohnOne Posted March 30, 2010 Posted March 30, 2010 (edited) Dont know how exel works but try this _ExcelBookSaveAs($oExcel, @DesktopDir & "\" & $iBatch, & ".xls") or _ExcelBookSaveAs($oExcel, @DesktopDir & "\" & $iBatch, ".xls") Edited March 30, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
l3ill Posted March 30, 2010 Author Posted March 30, 2010 Sweeeet! Thanks! it was this one: _ExcelBookSaveAs($oExcel, @DesktopDir & "\" & $iBatch, "xls") My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
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