Hyflex

Excel_BookOpen doesn't work at all, even using the example.

42 posts in this topic

Hi Guys,

I can't figure out why the latest version of AutoIt (ever since the rewrite of the excel) the Excel_BookOpen never works, I started from scratch using the example from: https://www.autoitscript.com/autoit3/docs/libfunctions/_Excel_BookOpen.htm but it never works...

See the screenshot below:

3tPlgZt.png

Anyone have any idea how to get this working?

I'm on Windows 10 (same happens on Windows 7) 64bit using Excel 2013 64bit.
Any advice would be welcome :)

Share this post


Link to post
Share on other sites



Your @Scriptdir is "C:\"? On Windows 10?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2016-12-04 - Version 1.2.2.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
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Your @Scriptdir is "C:\"? On Windows 10?

Yes, The script is in C:\OpenExcel.au3 and the Excel file is in C:\Excel.xlsm
See to the left of my screenshot :)

Share this post


Link to post
Share on other sites

Which version of AutoIt do you run?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2016-12-04 - Version 1.2.2.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
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Which version of AutoIt do you run?

The latest one from the website, which is 3.3.14.1 but it was happening on 3.3.14.0

Share this post


Link to post
Share on other sites

My advice to fix this would be to not have the document in the root of the C drive. This is a protected area and Windows doesn't like it when you try to access files in this location. If the script were run with admin privileges it might work, but if the user isn't an administrator on the computer it will fail every time.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

I suggest to run the unmodified example script. If it works then one of your modifications causes the problem ;)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2016-12-04 - Version 1.2.2.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
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

My advice to fix this would be to not have the document in the root of the C drive. This is a protected area and Windows doesn't like it when you try to access files in this location. If the script were run with admin privileges it might work, but if the user isn't an administrator on the computer it will fail every time.

Already tried multiple locations, downloads, desktop, documents, c, other hard drives all do the same thing. UAC is disabled and it's an admin account

I suggest to run the unmodified example script. If it works then one of your modifications causes the problem ;)

I did, look at the screenshot, all i changed was the location of the file and it's an xlsm not xls

Share this post


Link to post
Share on other sites

Did you run the UNmodified script, with the original file?

I ran the script using Excel 2013 and 2007, on Windows 7 and 10 and it worked for me. I don't have UAC turned off on either one though, but I am an admin on both machines.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

I'm sure the problem is being caused by either the location or the workbook itself. 

Please run the unmodified example script to make sure this assumption is correct. 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2016-12-04 - Version 1.2.2.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
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Did you run the UNmodified script, with the original file?

I ran the script using Excel 2013 and 2007, on Windows 7 and 10 and it worked for me. I don't have UAC turned off on either one though, but I am an admin on both machines.

 

I'm sure the problem is being caused by either the location or the workbook itself. 

Please run the unmodified example script to make sure this assumption is correct. 

%7Boption%7Dhttp://i.imgur.com/XEj3iyE.png

Edited by Hyflex

Share this post


Link to post
Share on other sites

Did you try? I know that it works! I tried.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2016-12-04 - Version 1.2.2.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
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Did you try? I know that it works! I tried.

I went back and edited, because at first I didn't know where the examples were because I got them straight from online documentation.

But yes, I tried and it still fails: 
http://i.imgur.com/XEj3iyE.png

Share this post


Link to post
Share on other sites

The COM error code stands for:

"The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))"

I have never worked with a 64 bit version of Office.
Could you add

#AutoIt3Wrapper_UseX64=y

at the top of your script and try again?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2016-12-04 - Version 1.2.2.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
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Still the same as far as I can see:

lOTMDpu.png

Share this post


Link to post
Share on other sites

Some recent problems were caused by misbehaving Addons. Could you please disable all Addons and try again?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2016-12-04 - Version 1.2.2.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
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

The COM error code stands for:

"The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))"

I have never worked with a 64 bit version of Office.
Could you add

#AutoIt3Wrapper_UseX64=y

at the top of your script and try again?

doubt that works when not run from the full scite4autoit3 version as i see msgbox errors displayed.

jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Some recent problems were caused by misbehaving Addons. Could you please disable all Addons and try again?

I have no plugins

doubt that works when not run from the full scite4autoit3 version as i see msgbox errors displayed.

jos

Tried both from scite and non both don't work

what happens if you create a excel fine with the script, close it, then have the script reopen it at the same location? If that file won't reopen then we know there is a problem that isn't AutoIt related.

I'm not sure how you mean.

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