Jump to content

Excel functions aren't working for me


Saytun
 Share

Recommended Posts

Hi, I'm trying to do some very basic Excel file manipulation. However, I can't even get AutoIt to open up Excel files for reading!

My code is extremely simple, taken verbatim from the help files.

#include <Excel.au3>

$sFilePath1 = @ScriptDir & "\filename.xls"; open excel file
$oExcel = _ExcelBookOpen($sFilePath1)

If @error = 1 Then
    MsgBox(0, "Error!", "Unable to Create the Excel Object")
    Exit
ElseIf @error = 2 Then
    MsgBox(0, "Error!", "File does not exist - Shame on you!")
    Exit
EndIf

Yes, "filename.xls" exists and is in the same directory as the .au3 script (both are on the desktop). When I try running the script, I get the "Unable to create the Excel object" error, so I'm not exactly sure what's wrong.

I don't actually have Microsoft Excel installed, but rather I'm using OpenOffice's alternative, could that be the problem here?

Link to comment
Share on other sites

  • Developers

I don't actually have Microsoft Excel installed, but rather I'm using OpenOffice's alternative, could that be the problem here?

You will require the Excel com objects for these UDFs to work tho!

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

It ain't easy, but there is an automation interface for OOo: Automating OpenOffice.org

Seems like an OOo.au3 UDF might just be possible at some point in the future...

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...