Fetching data from an external database and linking it to an excel macro using Python

Job ID: 31270570

Budget: £40 – £50 GBP

First I need a employee database containing data about employee shifts. The data attributes for each employee shift will be the columns in excel form. Each employee will have their own excel sheet of different number of rows of data (shifts).

I need to calculate fatigue and risk for each employee after each shift (which corresponds to a new row in the database-Each shift has specific column values entered as a new row with data corresponding to column names of the excel sheet). To calculate this, the excel sheet already has built in macro which can be executed to calculate the fatigue and risk index for all the rows of data. To test this, you just need to enter a new row of data in the cells and press calculate to view the result.

You can check the decrypted file to understand the VBA macro (you need to enable developer mode in excel and click visual basic to look at the forms and macros - the macros are under module and forms are under forms) and the template sheet is the excel file that will be specific to each employee detailing their shifts as rows.

There are two modes, risk index calculator and fatigue index calculator, and you can switch between them using the mode button

What I want to do:
1.Create a database of employee shifts based on 3 sample rows (3 sample shifts) and the 'defaults' form (see default_values screenshot-you can get this screen when you press the defaults button on the sheet). That is, I also want to store and fetch the data from the buttons in this form. These values affect the final formula to calculate the fatigue and risk index depending on what the current values are. These should be changeable in the database and I must be able to add information about more shifts to the database. I should also be able to create a new employee with information about his shifts.

2.Fetch the data from the database regarding an employee and all his shifts, fetch the current values in the defaults form and calculate the fatigue and risk index WITHOUT HAVING TO OPEN the excel form using Python.

3. Save the fatigue and risk index for the specific employee back to the database with Python

That is I want to find a way to avoid opening the form and directly using Python to manipulate data inside the database and excel macro to calculate fatigue and risk index. To do this, you'll need to fetch data from all the relevant cells and calculate it link it to the calculate index button to run the built in formula and fetch the result from the result cells in Python again.

The password to view the excel form and macros is 1234.

Feel free to ask any questions if you need more information. Looking forward to working with you!
Related categories: Python Database Programming Programming Excel VBA