Macro auto run on file creation.
Closed
markcdl
Posts
4
Registration date
Tuesday October 13, 2015
Status
Member
Last seen
October 13, 2015
-
Oct 13, 2015 at 03:59 AM
markcdl Posts 4 Registration date Tuesday October 13, 2015 Status Member Last seen October 13, 2015 - Oct 13, 2015 at 09:21 AM
markcdl Posts 4 Registration date Tuesday October 13, 2015 Status Member Last seen October 13, 2015 - Oct 13, 2015 at 09:21 AM
Related:
- Macro auto run on file creation.
- Windows 10 iso file download 64-bit - Download - Windows
- Grand theft auto v free download no verification for pc - Download - Action and adventure
- The joy of creation download - Download - Horror
- Facebook auto refresh - Guide
- Kmspico zip file download - Download - Other
1 response
markcdl
Posts
4
Registration date
Tuesday October 13, 2015
Status
Member
Last seen
October 13, 2015
Oct 13, 2015 at 09:21 AM
Oct 13, 2015 at 09:21 AM
In case anyone else runs into this problem, this is the scenario and how I combatted it:
We have a file emailed to us daily at 06:00, the file is automatically stripped from the email and saved to a specified folder with a default name, the file is written as a new file daily.
We needed to run a macro against the file, change some data, save it as a new file in a different location and have another process upload it to a FTP server.
This all needs to happen without any manual intervention, stage 1 and 3 were already accomplished, we could strip the attachments and have them renamed / uploaded as required. The problem we had was with the Macro we needed to run against one particular file.
We solved this by keeping open the personal-macro file in the background and adding the application.ontime option:
Application.OnTime TimeValue("17:00:00"), "my_Procedure"
inside of the my_Procedure sub enabling the macro to run at 17:00 each day opening the specifically named workbook and processing the data, all without the need to manually intervene.
We have a file emailed to us daily at 06:00, the file is automatically stripped from the email and saved to a specified folder with a default name, the file is written as a new file daily.
We needed to run a macro against the file, change some data, save it as a new file in a different location and have another process upload it to a FTP server.
This all needs to happen without any manual intervention, stage 1 and 3 were already accomplished, we could strip the attachments and have them renamed / uploaded as required. The problem we had was with the Macro we needed to run against one particular file.
We solved this by keeping open the personal-macro file in the background and adding the application.ontime option:
Application.OnTime TimeValue("17:00:00"), "my_Procedure"
inside of the my_Procedure sub enabling the macro to run at 17:00 each day opening the specifically named workbook and processing the data, all without the need to manually intervene.