Sign in to follow this  
Followers 0
tauruzian

Script fails in Microsoft Office 2013

10 posts in this topic

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.

Share this post


Link to post
Share on other sites



What does the COM error handler displaz?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

What does the COM error handler displaz?

Attached the screen shot after i run the script.

post-82822-0-73517200-1419387797_thumb.p

Share this post


Link to post
Share on other sites

#4 ·  Posted (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  :geek: seriously time for bed

Edited 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.

Share this post


Link to post
Share on other sites

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  :geek: 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.

Share this post


Link to post
Share on other sites

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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). 

Share this post


Link to post
Share on other sites

Then please hava a look at _Excel_BookAttach in the help file.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0