broliukaz Posted November 14, 2013 Posted November 14, 2013 Hi, I am the new in autoit and I have some problems, maybe someone can help me? When I launch program from editor window (F5) it works with no errors, but when I create .exe file I always get the error: @error = 1 Unable to Create the Excel Object Why? Here is my code: Func WriteToXls() ; ---------------------- write to xls ----------------------------------------------------- If GUICtrlRead($CheckBox) = $GUI_UNCHECKED Then Local $oExcel = _ExcelBookOpen($xlsTemplate, $fVisible) If @error = 1 Then MsgBox(0, "Error!", "Unable to Create the Excel Object") Exit ElseIf @error = 2 Then MsgBox(0, "Error!", "Template.xls does not exist!") Exit EndIf _ExcelWriteCell($oExcel, $readEQID, 5, 3) _ExcelWriteCell($oExcel, $readPN, 8, 3) _ExcelWriteCell($oExcel, $readSN, 11, 3) _ExcelWriteCell($oExcel, $fullEQRMA, 3, 3) _ExcelWriteCell($oExcel, $readProblem , 19, 3) _ExcelWriteCell($oExcel, $readSolution, 20, 3) _ExcelWriteCell($oExcel, $readDecission, 21, 3) _ExcelWriteCell($oExcel, $readNotes, 34, 3) _ExcelWriteCell($oExcel, $readAccessories, 3, 6) _ExcelWriteCell($oExcel, $readPrice, 21, 6) if _ExcelBookSaveAs($oExcel,$xlsDestination&$fullEQRMA, "xls", 1, 1) then _ExcelBookClose($oExcel) ; Close file Else MsgBox(4096, "Error", " Error Creating xls file. error:"&@error) EndIf EndFunc ; ---------------------------------- end write to xls -----------------------------------------------------
water Posted November 14, 2013 Posted November 14, 2013 Welcome to AutoIt and the forum! What's the value of $xlsTemplate? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
broliukaz Posted November 14, 2013 Author Posted November 14, 2013 Welcome to AutoIt and the forum! What's the value of $xlsTemplate? Hi, here is the value of xls template and other values: Global $fVisible = 0 ; <====== xls visible =1, invisible =0 Global $xlsTemplate = "C:\EQ\Template.xls" Global $xlsDestination = "D:\WORK\HHT\Hardware\Repairs\"
water Posted November 14, 2013 Posted November 14, 2013 You are running the Exe on the same machine? Where do you store the Exe (C:, D:?) My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
broliukaz Posted November 14, 2013 Author Posted November 14, 2013 Yes, on the same mashine, even in the same script directory on my desktop: C:Userseimantas_sDesktoptest8
water Posted November 14, 2013 Posted November 14, 2013 Next step is to add a COM error handler to get more detailed error information. Please add the following code to your script: Global $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") ; ... Your code goes here Func _ErrFunc($oError) MsgBox(0, "COM error", "err.number is: " & @TAB & $oError.number & @CRLF & _ "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ "err.description is: " & @TAB & $oError.description & @CRLF & _ "err.source is: " & @TAB & $oError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ "err.retcode is: " & @TAB & $oError.retcode) EndFunc ;==>_ErrFunc My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
broliukaz Posted November 14, 2013 Author Posted November 14, 2013 Thank you! i added this code and I get the error: What it means? Free space on my computer HDD: C: 175GB free, D: 219GB free
water Posted November 14, 2013 Posted November 14, 2013 Sorry, I can't access Dropbox from my office. Can you post the screenshot here or send it to me using the private mail of the forum? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
broliukaz Posted November 14, 2013 Author Posted November 14, 2013 Sorry, I can't access Dropbox from my office. Can you post the screenshot here or send it to me using the private mail of the forum? I can't add an simple picture here, only url. maybe here you can see: http://www.flickr.com/photos/104560777@N03/10852346026/lightbox/
water Posted November 14, 2013 Posted November 14, 2013 I got this picture. Is this the correct one? if yes then it is completely unrelated to Excel or AutoIt. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
broliukaz Posted November 14, 2013 Author Posted November 14, 2013 I got this picture. Is this the correct one? if yes then it is completely unrelated to Excel or AutoIt.Screenshot.jpg oh, I am sorry, I have made a mistake, I uploaded wrong photo! here is this is picture from autoit:'' target='_blank'>>
water Posted November 14, 2013 Posted November 14, 2013 The error code -2147024882 (decimal) is 0x8007000E (hex) and means: E_OUTOFMEMORY How big is your Workbook? Which version of Excel do you run? Which operating system do you run? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
broliukaz Posted November 14, 2013 Author Posted November 14, 2013 The error code -2147024882 (decimal) is 0x8007000E (hex) and means: E_OUTOFMEMORY How big is your Workbook? Which version of Excel do you run? Which operating system do you run? I am using Windows 8 Pro 64bit and MS Excel 2013 The workbook size is 36,5 KB
water Posted November 14, 2013 Posted November 14, 2013 Do you run the 32 or 64 bit version of Excel? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
water Posted November 14, 2013 Posted November 14, 2013 Can you please run this stripped down reproducer script? #include <Excel.au3> Global $fVisible = 1 Global $xlsTemplate = "C:\EQ\Template.xls" Global $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") Global $oExcel = _ExcelBookOpen($xlsTemplate, $fVisible) MsgBox(0, "", "@error = " & @error) Exit Func _ErrFunc($oError) MsgBox(0, "COM error", "err.number is: " & @TAB & $oError.number & @CRLF & _ "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ "err.description is: " & @TAB & $oError.description & @CRLF & _ "err.source is: " & @TAB & $oError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ "err.retcode is: " & @TAB & $oError.retcode) EndFunc ;==>_ErrFunc My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
broliukaz Posted November 14, 2013 Author Posted November 14, 2013 (edited) This script opens my excel template and then msgbox with message: @error = 0 Should I paste full program code to you? Edited November 14, 2013 by broliukaz
water Posted November 14, 2013 Posted November 14, 2013 So it's not a problem with Excel. How often do you call function WriteToXLS? Is there something else in your code that could cause this problem? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
broliukaz Posted November 14, 2013 Author Posted November 14, 2013 so far I've used this function only once. Maybe it's some permission or security problem, but I try to run as Administrator, but I've got the same error...
water Posted November 14, 2013 Posted November 14, 2013 I don't think it is a permission problem. Either a bug in Excel 2013 or Windows 8 or something else. If you open the task manager - how much memory does the Exe use? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
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