mysticmario
Active Member
- Joined
- Nov 10, 2021
- Messages
- 323
- Office Version
- 365
- Platform
- Windows
Hi, I have new issue.
I made an hour counter which I want to sue to track time of the employees.
I have this workbook open event where it saves the data multiple times during the day.
I set the clocker on a tablet with windows. The tablet always stays awake, never disconnects form the web and It is always power supplied.
The call clock event runs a macro that constantly updates worksheet cell with current time using =Now+TimeValue(00:00:01)(simplified code)
So in theory the excel is constantly being "worked on". However when i clock in the first ontime event at 8:15 runs fine but the other on time never run.
I tested it previously with the times beign brougth close together and it was workign fine, the problem happens when the ontime events are far apart.\
Here's the code:
I made an hour counter which I want to sue to track time of the employees.
I have this workbook open event where it saves the data multiple times during the day.
I set the clocker on a tablet with windows. The tablet always stays awake, never disconnects form the web and It is always power supplied.
The call clock event runs a macro that constantly updates worksheet cell with current time using =Now+TimeValue(00:00:01)(simplified code)
So in theory the excel is constantly being "worked on". However when i clock in the first ontime event at 8:15 runs fine but the other on time never run.
I tested it previously with the times beign brougth close together and it was workign fine, the problem happens when the ontime events are far apart.\
Here's the code:
VBA Code:
Private Sub Workbook_Open()
Application.DisplayFullScreen = True
Call clock
Application.DisplayAlerts = False
Sheets("MAIN").Select
Sheets("Aktualnie zalogowani").Select
Sheets("Aktualnie zalogowani").Copy
ChDir "C:\listy obecnosci"
ActiveWorkbook.SaveAs Filename:= _
("C:\listy obecnosci\Lista obecności" & Format(Now(), "DD-MMM-YYYY-HH-MM") & ".xlsx"), FileFormat:= _
xlOpenXMLWorkbook, CreateBackup:=False
ActiveWindow.Close savechanges = False
Sheets("MAIN").Select
Application.DisplayAlerts = True
Application.OnTime TimeValue("8:15:00"), "WorkbookSave"
Application.OnTime TimeValue("18:00:00"), "WorkbookSave"
Application.OnTime TimeValue("23:58:00"), "WorkbookSave"
Application.OnTime TimeValue("23:59:00"), "WorksheetClear"
End Sub