swstrau118 Posted April 13, 2013 Posted April 13, 2013 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 - 4pmPerson 2 - 5pm - 9pmPerson 3 - 10pm - 3amThey 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
water Posted April 13, 2013 Posted April 13, 2013 This should you get started. 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
swstrau118 Posted April 13, 2013 Author Posted April 13, 2013 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?
stormbreaker Posted April 13, 2013 Posted April 13, 2013 (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 April 13, 2013 by MKISH ---------------------------------------- :bye: Hey there, was I helpful? ---------------------------------------- My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1
water Posted April 13, 2013 Posted April 13, 2013 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 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
swstrau118 Posted April 16, 2013 Author Posted April 16, 2013 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
water Posted April 16, 2013 Posted April 16, 2013 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 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now