kavkazi
10-13-2010, 08:55 AM
Hello,
I have an excel file which if opened at 19:00, it automatically runs a macro. When it's done, I would like to close the workbook and the excel application.
The problem is, it closes the workbook, but the excel applications stays open. I know this is tricky in VBA, and I can't figure out a way to do this.
Here is my code:
Private Sub Workbook_Open()
If Hour(Now) = 19 Then
process
Me.Close True
Application.Quit
End If
End Sub
Thanks in advance!
I have an excel file which if opened at 19:00, it automatically runs a macro. When it's done, I would like to close the workbook and the excel application.
The problem is, it closes the workbook, but the excel applications stays open. I know this is tricky in VBA, and I can't figure out a way to do this.
Here is my code:
Private Sub Workbook_Open()
If Hour(Now) = 19 Then
process
Me.Close True
Application.Quit
End If
End Sub
Thanks in advance!