Sign in to follow this  
Followers 0
b1nd3r512

Saving a excel document after data refresh

4 posts in this topic

Hi Guys

Sorry im new to autoit and coding in general i have a basic understanding.

Heres what im trying to do and i hope someone can help.

I need to open a excel document that retrieves data from sql and then saves the excel files with todays date.

Basically we are pulling reports daily to see who does what in our warehouse. 

The problem is the data refresh once the excel document is open takes about 5 minutes to generate.

Here is my starting code of just opening the document. 

"

run('"C:Program Files (x86)Microsoft OfficeOffice14EXCEL.EXE" "C:Test"')
"
the sheet will pull the data automatically but how do i get the script to save the file AFTER the data has been recieved and with todays date.
 
Regards
Red

Share this post


Link to post
Share on other sites



Welcome to AutoIt and the forum!

You could use the Excel UDF that comes with AutoIt to open and save the Workbook.

I haven't tested it but I think the _ExcelBookOpen function will return after the data has been loaded. Then you can save the updated Workbook.


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

Sounds good thanks man ill give it a try the problem is im trying to automate this whole process. So 5pm script runs, It opens file generates results and after 5-10min it saves as the current date and closes excel :/

Share this post


Link to post
Share on other sites

Which file format do you want to work with: xls or xlsx?


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

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  
Followers 0