Jump to content
ashly

Why can't i save a new excel file?

Recommended Posts

ashly

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
ashly

@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
water

Which version of Office do you run?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - 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
water

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 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - 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
ashly

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

×