Hello everybody,
I have what I assumed was a pretty simple code, but for some reason it keeps rerunning, so perhaps there is an error in my code, or maybe just a smarter way to go about doing this.
Here is the This workbook code:
The userform start only has 1 piece of code behind it:
Module 1 only has 2 subs in it:
All I'm doing is creating a few folders based on cell values (which it creates the first time, then pops errors and still tries to run)
This program is open by windows task scheduler at 9am everyday. There is a delay in the process for the userform to be visible for 15 at start and finish of the program.
any assistance would be greatly appreciated.
I have what I assumed was a pretty simple code, but for some reason it keeps rerunning, so perhaps there is an error in my code, or maybe just a smarter way to go about doing this.
Here is the This workbook code:
VBA Code:
Private Sub Workbook_Open()
Application.Visible = False
Start.Show
End Sub
VBA Code:
Sub UserForm_Initialize()
Application.ScreenUpdating = False
Me.StartUpPosition = 0
Me.Left = Application.Left + (0.5 * Application.Width) - (0.5 * Me.Width)
Me.Top = Application.Top + (0.5 * Application.Height) - (0.5 * Me.Height)
Start.Label1.Caption = "I am creating your daily folders right now."
Start.Label2.Caption = "Folders will be created for the following Directories:"
Me.Repaint
Application.OnTime Earliesttime:=Now + TimeValue("00:00:15"), _
Procedure:="Module1.folders", _
Schedule:=True
'The times listed are running total not individual...
Application.OnTime Earliesttime:=Now + TimeValue("00:00:30"), _
Procedure:="Module1.closeit", _
Schedule:=True
End Sub
VBA Code:
Sub folders()
Sheets("FOLDERS").Select
MkDir [D4&E4]
MkDir [D5&E5]
MkDir [D6&E6]
'MsgBox "Folders Made Successfully"
Sheets(1).Select
Start.Label1.Caption = "Ok, Drew, I'm all done for today! It has been a pleasure to serve you!"
Start.Label2.Caption = "Folders were created for the following Directories:"
Start.BackColor = &HC00000
Start.Repaint
End Sub
Sub closeit()
Start.BackColor = &H8080&
Sheets(1).Select
Application.ScreenUpdating = True
ActiveWorkbook.Save
Application.Visible = True
ActiveWorkbook.Close
End Sub
All I'm doing is creating a few folders based on cell values (which it creates the first time, then pops errors and still tries to run)
This program is open by windows task scheduler at 9am everyday. There is a delay in the process for the userform to be visible for 15 at start and finish of the program.
any assistance would be greatly appreciated.