tauruzian Posted December 23, 2014 Share Posted December 23, 2014 Local $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") #include <Excel.au3> Global $oExcel = _Excel_Open() Global $oWorkbook = $oExcel.ActiveWorkbook MsgBox(0, "Error", $oWorkbook.Name) winActivate($oWorkbook.Name) Send ("^c") Exit Func _ErrFunc($oError) ConsoleWrite("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 & @CRLF & @CRLF) EndFunc ;==>_ErrFunc Above code working fine for Office 2010 and it seems like not functioning for 2013. Do i need to change anything.? Please advice. Thanks. Link to comment Share on other sites More sharing options...
water Posted December 23, 2014 Share Posted December 23, 2014 What does the COM error handler displaz? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
tauruzian Posted December 24, 2014 Author Share Posted December 24, 2014 What does the COM error handler displaz? Attached the screen shot after i run the script. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 24, 2014 Moderators Share Posted December 24, 2014 (edited) Is it just me? 1. Your title says outlook, your code says excel 2. Your popup is not an error, it shows you the name (a success) Edit: Scratch 1. I read outlook and it said office seriously time for bed Edited December 24, 2014 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
tauruzian Posted December 24, 2014 Author Share Posted December 24, 2014 Is it just me? 1. Your title says outlook, your code says excel 2. Your popup is not an error, it shows you the name (a success) Edit: Scratch 1. I read outlook and it said office seriously time for bed 1. Its Microsoft Office 2013. 2. Yes, I'm getting the pop up but it seems like it stop after that, it doesn't activate the document. Link to comment Share on other sites More sharing options...
water Posted December 24, 2014 Share Posted December 24, 2014 The script misses _Excel_BookOpen to open a workbook. _Excel_Open only starts the Excel application. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
tauruzian Posted January 2, 2015 Author Share Posted January 2, 2015 The script misses _Excel_BookOpen to open a workbook. _Excel_Open only starts the Excel application. _Excel_BookOpen needs Path and filename as parameter. In my case, based on the code above I'm only getting the filename. I unable to use _Excel_BookOpen since I don't have the path. Link to comment Share on other sites More sharing options...
water Posted January 2, 2015 Share Posted January 2, 2015 Do you want to connect to a Workbook opened by the user or do you want to open the Workbook by your script? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
tauruzian Posted January 6, 2015 Author Share Posted January 6, 2015 Do you want to connect to a Workbook opened by the user or do you want to open the Workbook by your script? Opened by user. User may open the workbook from any location (local or server). Link to comment Share on other sites More sharing options...
water Posted January 6, 2015 Share Posted January 6, 2015 Then please hava a look at _Excel_BookAttach in the help file. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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