Jump to content
Sign in to follow this  
bootybay

_ExcelBookSaveAs not creating files

Recommended Posts

bootybay

I just wanted to try exmaple 1 but there is no .xls file created. Even if i use "C:TestTemp.xls" instead of that @TempDir path it doesn't save anything.

#include <Excel.au3>

Local $oExcel = _ExcelBookNew() ;Create new book, make it visible

_ExcelWriteCell($oExcel, "I Wrote to This Cell", 1, 1) ;Write to the Cell

MsgBox(0, "Exiting", "Press OK to Save File and Exit")
_ExcelBookSaveAs($oExcel, @TempDir & "\Temp.xls", "xls", 1, 1) ; Now we save it into the temp directory; overwrite existing file if necessary
_ExcelBookClose($oExcel) ; And finally we close out

I'm missing something but I can't see what.

Share this post


Link to post
Share on other sites
water

Don't know what is wrong but you need to add some error checking to your script.

Every function sets the returnvalue or macro @error in an case of an error. The help file explains what to check.


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

You need to povide more information:

Which version of Excel do you run?

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
water

The example you provided in post #1 runs fine here and creates the Excel file.

What is the value of @TempDir?


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
bootybay

You need to povide more information:

Which version of Excel do you run?

Which version of AutoIt do you run?

 

You already solved the mystery. I didn't know I needed Excel since I work with google docs. I thought it would just create a spreadsheet and I would just import it.

Thank you for helping me out.

May I use OpenOffice or do I need Microsoft Excel for this?

PS: @TempDir isn't the problem its value is the standard C:Users***AppDataLocalTemp and I tried fixed paths aswell already.

Share this post


Link to post
Share on other sites
water

To run the Excel UDF you need MS Excel installed.

There is an OpenOffice Calc UDF available on the forum. But I'm not familiar with it.

There are UDFs available on the forum to read/create Excel files without having Excel installed.

I might provide further information if I know which route you want to take.


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
bootybay

I'm interested in the nonExel UDFs.

 

I'm confident that I would be able to work with the Excel.au3 if I wanted to install Office.

Share this post


Link to post
Share on other sites
water

Reading XLSX files: >www.autoitscript.com/forum/topic/145160-xlsxreadtoarray-using-only-autoit

Create XLSX files: '?do=embed' frameborder='0' data-embedContent>>

You could use ADO. This means an Excel workbook is treated like a database:


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

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  

×