I'm working on a project to update production notes in a manufacturing schedule. I've written a macro called "Open_SFCDB" to pull in the data to the manufacturing schedule and I need to execute the macro in the file automaticaly every 15 minutes, but only while the user has the manufacturing schedule open.
I've done this by schedule the macro once only in the open event & storing the run time in a public variable. The macro then update the run time for the next interval and reschedule itself. The beforeclose event of the workbook then cancels the scheduled run using the final parameter of Ontime – this works fine on it’s own.
However my problem now is that I already have some existing vba in the file to close the file automatically after a period on inactivity – which also works fine on it’s own.
But when I’m trying to blend both requirements into the open event I’m getting the following error “Compile Error – Ambigious name detected – Run When”
I'm pretty new to VBA so any assistance in helping me combine the codes would be much appreciated.
See 2 sets of Code I’m trying to combine below
Existing Code 1:
New Code 2:![]()
Please Login or Register to view this content.
Normal module![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
Bookmarks