Jump to content

Recommended Posts

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
Posted

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.

Posted

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
Posted

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

Posted

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.
Posted

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 2024-07-28 - Version 1.6.3.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 (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

 

  • 2 weeks later...
Posted

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!

  • 6 months later...
Posted

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

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
×
×
  • Create New...