Jump to content

Recommended Posts

Posted

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
Posted

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 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted

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 :/

Posted

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

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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
×
×
  • Create New...