This is my mission: users will run my two macros on a daily basis (BDs only) as a W XP Pro Scheduled Task. The macros are digitally signed and the certificate will be 'accepted' by the users. My preference is for there to be zero windows displayed on the users' monitors when the macro is triggered by the Scheduled Task. One macro sends out an e-mail (selects one of five depending upon results of a calculated cell) and saves three worksheet files to a specified location; the other macro prints a specified range on each of three worksheets.
I am using 'Application.Visible = False' at the beginning of each macro and 'Application.Visible = True' immediately preceding each of the 'Application.Quit's. In each of the macro files, the 'IsAddin' Property of 'ThisWorkbook' is set to 'True' (apparently, whether the files are saved with .xlA or .xlS is irrelevant).
The above is accomplishing most of my wishes. When each macro is triggered, the grey screen appears for 2 seconds <-- this is due to 'Handshaking' re: the digital certificate, then it disappears, the macro continues to run for about 30 seconds (as files are opened and closed, there are zero application buttons opening and closing on the W XP Pro Taskbar), then one of two things happens depending if it is Macro 1 or Macro 2: the e-mail draft appears briefly before it is 'Sent'; or three pop-ups appear in rapid succession indicating that each of the three worksheet print jobs has been sent to the printer -- lastly, immediately before each instance of Excel is shut down, a conventional Excel blank worksheet window (with cell divisions) appears for about one second <-- this is due to the 'Application.Quit'. (Upon inserting a 'MsgBox' before the 'Application.Quit', I see that the grey screen window is displayed -- this is the result of the 'Application.Visible = True'. When running at full-speed, this second grey screen is 'invisible'.)
Any ideas on eliminating the 2-second grey screen and the 1-second conventional Excel blank worksheet screen?
Chuckles123
Bookmarks