Sign in to follow this  
Followers 0
swstrau118

GUI Display information according to current time (HELP!)

8 posts in this topic

I'm new at programming, is it possible to write a program that could reference an excel, csv (any file type) on your GUI, so when you press a button it would display that information.

Explained:

Say you are making an On Call schedule for your 3 employee's - each person is on call at different times of the day:

  • Person 1 - 8am - 4pm
  • Person 2 - 5pm - 9pm
  • Person 3 - 10pm - 3am
They are located in an excel file. The GUI would have a button to when you click on the button it would take the current time and display (inside the GUI or msg box) who would be on call based on the time. Is this program possible? If so please help! I'm lost on how I could start and have been researching.

Thanks

Share this post


Link to post
Share on other sites



This should you get started.


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

Maybe its because I'm really tired - how could I use that function to relate off an excel spreadsheet (or something) to display the information I need according to the time?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Not exactly what you wanted, but still could be of great help for a starter.

_CallOfDuty()

Func _CallOfDuty()
$HOUR = @HOUR
If $HOUR >= 8 AND $HOUR <= 16 then msgbox(64, 'Your dearest PC says:', 'I think person-1 on duty for now.')
If $HOUR >= 17 AND $HOUR <= 21 then msgbox(64, 'Your dearest PC says:', 'I think person-2 on duty for now.')
If $HOUR >= 22 OR $HOUR <= 3 then msgbox(64, 'Your dearest PC says:', 'I think person-3 on duty for now.')
EndFunc

WHAT IT DOES? It'll display a message telling which person should be on-duty at the time when it is opened. I leave dealing with CSV part for others. I'm too lazy for it.

Good luck with your app.

Edited by MKISH

----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Share this post


Link to post
Share on other sites

First you need to read the data form a Excel workbook. Use the Excel UDF that comes with AutoIt. Functions _ExcelBookOpen and _ExcelReadCell or _ExcelReadSheetToArray will do what you need


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

Thanks for everyone's help so far, I was reading up on the Excel functions and it looks like you can only look at specific cell numbers and such. What happens if it changes? Here is an example schedule of mine that I created that I am looking to use. Any help is greatly appreciated!

Coverage Calendar and Contact Information - April 2013.xlsx

Share this post


Link to post
Share on other sites

You either read the whole sheet into an array and then search for the relevant content. Or you search in Excel for one of the header lines and then read the needed cells.


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

Ah ok - let me try that! Thanks

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