ashly

Why can't i save a new excel file?

8 posts in this topic

I would like to create a new excel workbook and using below scripts.

But it fails with @error=5 and @extended=-2147352567

I can't find out which part is wrong. Please help me~~~

#include <Excel.au3>

Local $oResultExcel = _Excel_Open(False)
Local $oResultBook = _Excel_BookNew($oResultExcel, 1)
_Excel_BookSaveAs($oResultBook, "C:\test.xlsx", $xlWorkbookDefault)
If @error Then Exit MsgBox(0, "Error!", "Error saving workbook to '" & $oResultBook & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended)

Share this post


Link to post
Share on other sites



@l3ill

Thanks for you reply.

The path is just for this post. I'm actually using another path to save it in my USB stick.

Share this post


Link to post
Share on other sites

Which version of Office do you run?


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

The decimal value of @extended translates to 0x80020009. This means: General Error.
Only the error text would give more detailed error information.

Which version of AutoIt do you run?


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

I just changed the path to desktop then it works!

Don't know why i cannot save it to my USB.

Anyway, thank you so much, @l3ill  :D

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