Sign in to follow this  
Followers 0
KalleB

Excel 2010

10 posts in this topic

#1 ·  Posted (edited)

I have been searching the forum, both internally and with google, and all I come up with is which doesn't help me at all.

As far as I can tell (Excel -> File -> Help) I have a 32-bit version of Excel and (Win + Pause|Break) 64-bit Win 7 Home Premium.

Running the AU3 file, running a compiled version or running a compiled (X86) version all give the same result:

0

1

When running

#include <Excel.au3>

$oExcel = _ExcelBookNew()

MsgBox(1, "", $oExcel & @CRLF & @error)

either from Desktop (c:\user\<username>\desktop) or from d:\temp

I recall having this problem before, being able to use the _Excel UDF functions at work, with Win XP and Excel 2007, but the same scripts failing at home. Unfortunately I can't test at work during the weekend (and I'd like to know a solution before Monday...).

So... I gather there is a problem with Excel 2010. But is there any solution? Either a ready solution, or a solution that some helpful person is working on?

And yes, that is with 3.3.6.1

Edited by KalleB

Share this post


Link to post
Share on other sites



I have the same problem since upgrading to Office 2010 last night.

@error responds with 1 when trying to open or create an xls or xlsx file, and Excel does not start.

Share this post


Link to post
Share on other sites

Try this code and tell me if it works;

$oExcel = ObjCreate("Excel.Application")
$oExcel.Visible = 1
$oExcel.Workbooks.Add

Share this post


Link to post
Share on other sites

Try this code and tell me if it works;

$oExcel = ObjCreate("Excel.Application")
$oExcel.Visible = 1
$oExcel.Workbooks.Add

No, it points to the ".Visible" and says "Variable must be of type 'Object'." Same result whether Excel is open or not. $oExcel is 0 and @ERROR is -2147221005

Share this post


Link to post
Share on other sites

Well man I have excel 2010 here and this line worked for me(it just opens an excel file)

$excel_file = _ExcelBookOpen("C:\Users\Macedo\Desktop\nei3.xlsx")

Switch ""C:\Users\Macedo\Desktop\nei3.xlsx" To the path of a file you wanna open

Share this post


Link to post
Share on other sites

Well man I have excel 2010 here and this line worked for me(it just opens an excel file)

$excel_file = _ExcelBookOpen("C:\Users\Macedo\Desktop\nei3.xlsx")

Switch ""C:\Users\Macedo\Desktop\nei3.xlsx" To the path of a file you wanna open

Doesn't work, neither with .xls nor .xlsx, neither with Excel opened nor closed, and neither with the filename as a string in the _ExcelBookOpen nor first assigning it to a variable.

Share this post


Link to post
Share on other sites

I was having similar troubles when running 64 bit Windows 7 with the 32 bit version of Office. I had to compile the script as 32 bit and everything went find.


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)

Did you try reinstalling office ?

#requireadmin ?

Edited by Juvigy

Share this post


Link to post
Share on other sites

Did you try reinstalling office ?

#requireadmin ?

No I haven't tried reinstalling Office, and I won't do it, since the code works in the environment where it will be used (older Excel), just would be neat to be able to write code at home when I'm sleepless. :)

#requireadmin did nothing but ask for permission, no change in outcome.

I think I might give up getting this to work, atleast until I find that a reinstall of Office will be done. Thanks to all who tried!

Share this post


Link to post
Share on other sites

I was having similar troubles when running 64 bit Windows 7 with the 32 bit version of Office. I had to compile the script as 32 bit and everything went find.

For this can be used Autoit3Wrapper macro in full Scite4Autoit3

Just add this line at top of your script and compile it from full Scite4Autoit3 (by F7)

#AutoIt3Wrapper_UseX64=n

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