rapt3r

Variable must be of type "Object" Error [excel]

19 posts in this topic

#1 ·  Posted

Hi everyone,

i got a script, where i open up excel attachments in outlook and copy them out with rangecopypaste into another excel file.

Now, when i got alot of outlook mails and attachments after some time of perfect processing i got this error everytime:

"C:\Program Files (x86)\AutoIt3\Include\Excel.au3" (227) : ==> Variable must be of type "Object".:
$oExcel.Windows($oWorkbook.Name).Visible = $bVisible
$oExcel.Windows($oWorkbook.Name)^ ERROR

 

This error happens only, when i got a big amount of emails and attachments. If i run my script with "less" mails and attachments, everything works fine.

This error code doesnt seem to a problem within my script, because the "excel.au3" causes it.

Has someone an idea what i could do?

 

thanks alot

Share this post


Link to post
Share on other sites



#2 ·  Posted

Please download fixes for this Excel functions:

 


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

#3 ·  Posted

Hi Water,

you are fast as always. Unfortunately im running Version 3.3.14.2, so there is nothing to update?

Share this post


Link to post
Share on other sites

#4 ·  Posted

The UDFs in the latest version of AutoIt have a couple of small bugs in them. You have to open the UDFs in your include file and replace the functions with the fixed ones that water stated in that thread.


UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI=

Share this post


Link to post
Share on other sites

#5 ·  Posted

Post #3 in the thread I mentioned above is misleading :( 
You need to update the UDFs when you run AutoIt > 3.3.12.0


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

#6 ·  Posted

Have you tried putting a small sleep between the passes in your loop? I think excel just hangs a bit when working with a lot of mails and files.

Share this post


Link to post
Share on other sites

#7 ·  Posted

Never seen the need to insert Sleep statements when working with the Excel UDF. It uses COM so the script execution only continues when the previous command has finished processing.


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

#8 ·  Posted (edited)

Ok, ive updated as mentioned and the script runs better i think.

But now i have a new Problem. Around 3:40 MIN autoit crashes...

Getting the error "autoit3.exe has stopped working" and there is this message when debugging:

An unhandled win32 exception occured in autoit3.exe [8952]

Tried it two times and it crashes at the same spot.

Is there any crashlog, when the programm crashes?

Edited by rapt3r

Share this post


Link to post
Share on other sites

#9 ·  Posted

If you search the forum (or the web) you will find some threads on this issue.


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

#10 ·  Posted

39 minutes ago, water said:

If you search the forum (or the web) you will find some threads on this issue.

Have tried to find something, but it seems i cant find something useful.

I manage to process around 30-40 attachments and then autoit crashes everytime.

Im getting this exit code: 3221225477.

 

Is there any hope?

 

Share this post


Link to post
Share on other sites

#11 ·  Posted

Ok. Got a new finding.

When im running my Script with the x64 bit version of autoit. Then it works...

Tomorrow i will test it with more data.

Share this post


Link to post
Share on other sites

#12 ·  Posted

So the questions is:
Which version of Excel do you run? 32 or 64 bit?


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

#13 ·  Posted

15 hours ago, water said:

So the questions is:
Which version of Excel do you run? 32 or 64 bit?

ok, did a few testings and found out, that my script works perfectly when running my script with x64. So problem fixed.

checked the excel version and im running 2013 with 32bit. Unfortunately i cant upgrade to x64 excel here.

Share this post


Link to post
Share on other sites

#14 ·  Posted

Usually you need to run AutoIt as 64bit when Office is 64bit. But it seems something else in your script needs 64bit.
Without having seen your code this is where the story ends :) 


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

#15 ·  Posted (edited)

8 minutes ago, water said:

Usually you need to run AutoIt as 64bit when Office is 64bit. But it seems something else in your script needs 64bit.
Without having seen your code this is where the story ends :) 

Ah you mean, that autoit would run automatically in x64, when excel would be in x64 also? Then you got a typo in your text;)

Thanks alot for your fast help!

 

btw. is there a statement which can be build in, to force autoit to run in x64?

Edited by rapt3r

Share this post


Link to post
Share on other sites

#16 ·  Posted

No, Autoit does not run automatically in x64. You need to compile for x64 when you use the 64bit version of Office and any of the Office UDFs.


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

#17 ·  Posted

1 minute ago, water said:

No, Autoit does not run automatically in x64. You need to compile for x64 when you use the 64bit version of Office and any of the Office UDFs.

hmm. but my office runs in 32bit and when im compiling in x64, everything works perfectly. so i dont necessarly have to use office 64bit?

Share this post


Link to post
Share on other sites

#18 ·  Posted

Correct.

1 person likes this

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

#19 ·  Posted

5 hours ago, rapt3r said:

is there a statement which can be build in, to force autoit to run in x64?

Put this at the top of your code:

#AutoIt3Wrapper_UseX64=Y

 

1 person likes this

UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI=

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