Jump to content

_Excel_Open() failed


Recommended Posts

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

Link to comment
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)
 

Link to comment
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 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
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.  

Link to comment
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 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
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.

Link to comment
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 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
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

Link to comment
Share on other sites

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

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...