Viking12345

_Excel_Open() failed

13 posts in this topic

Hello Guys,

I am doing the excel automation in current project. And I tried to run the example code of _Excel_Open(), I got the @error=1, @extended=-2147221164. 

My OS is : WIN7 Pro SP1 64bit. Office: Office Home and Business 2013 - en-us. 

I also tried to use TCL to accomplish the automation of excel, but i got similar error - "can't create object. "

C:\Users\Leo>tclsh
% package require tcom
3.9
% set application [::tcom::ref createobject "Excel.Application"]
0x800700c1 {Unknown error 0x800700C1}
%
 

Thanks you in advance. 

Regards

Leo

 

 

 

Snap1.jpg

Snap60.jpg

Share this post


Link to post
Share on other sites



Sorry, i forgot to attach the autoit code. Here it is.

#include <Excel.au3>
#include <MsgBoxConstants.au3>

; *****************************************************************************
; Create application object or connect to an already running Excel instance
; *****************************************************************************
Local $oExcel = _Excel_Open()
If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_Open Example 1", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_Open Example 1", "Excel Application has been opened successfully." & @CRLF & @CRLF & "Will _Excel_Close close the application?: " & @extended)
 

Share this post


Link to post
Share on other sites

And which version of AutoIT?

Share this post


Link to post
Share on other sites

It is Autoit v3. 

 

 

Share this post


Link to post
Share on other sites

I'm not familiar with the "Office Home and Business 2013" version of MS Office.
Does this version come with COM so that office can be automated? I know that trial versions of MS Office miss COM. Even if you upgrade to a full version COM is still missing. You have to uninstall the trial version and then install Office again to get COM.


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

Today, I took hours to troubleshooting. I found that if the excel is opened already. Then the Excel_Open can be working in AutoIT. 

So I have a workaround solution, but still it is very uncomfortable to use like this way. 

My colleague tried same code which is working fine on his computer.  

Share this post


Link to post
Share on other sites

Then I think this is a problem with the Excel installation. Most of the time it can be solved by re-installing Excel.


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)

7 hours ago, Viking12345 said:

It is Autoit v3. 

 

 

Next time i ask you about AutoItverion I want:

Quote
@AutoItVersion : Version number of AutoIt such as 3.3.14.1

because i suggest it is a V3 version.

Edited by AutoBert

Share this post


Link to post
Share on other sites
18 hours ago, AutoBert said:

Next time i ask you about AutoItverion I want:

because i suggest it is a V3 version.

Sorry. I thought this issue is not related with AutoIT version. The detail version is 3.3.14.1. 

Share this post


Link to post
Share on other sites
On 1/27/2016 at 3:30 PM, water said:

I'm not familiar with the "Office Home and Business 2013" version of MS Office.
Does this version come with COM so that office can be automated? I know that trial versions of MS Office miss COM. Even if you upgrade to a full version COM is still missing. You have to uninstall the trial version and then install Office again to get COM.

It can be automated in this office version. My colleague can do createobject with same office version and windows version. 

I am thinking there might be something wrong with my office. I tried uninstall and install, but got same error.

Share this post


Link to post
Share on other sites

The error you get means: "* is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)"

You need to compile your script for the bitness of Office, not for the bitness of WIndows. I assume your Office is still 32 bit so you need to compile your script for 32 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
15 hours ago, water said:

You need to compile your script for the bitness of Office, not for the bitness of WIndows. I assume your Office is still 32 bit so you need to compile your script for 32 bit.

Hello water,  I am using 32 bit office.  The strange thing is my workmate has same setting(Office + windows+AutoIT), but he works fine with createobject "Excel.Application".

Currently, I am using the workaround solution, if the createobject failed, i will try to open excel, then try again.

Snap61.jpg

Share this post


Link to post
Share on other sites

Do you have multiple versions of Excel installed on your computer?

 


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