oldcitycat
Board Regular
- Joined
- Sep 23, 2011
- Messages
- 71
Would someone please explain why the Excel process continues to run even after Closing and Quitting.
From my limited understanding I thought sourceWB.Close & xlApp.Application.Quit would do the trick.
What Am I missing?
Thank you in advance for any and all suggestions
OldCityCat
From my limited understanding I thought sourceWB.Close & xlApp.Application.Quit would do the trick.
What Am I missing?
Code:
Private Sub UserForm_Initialize()If TimeCard.tbEmployeeID.Value = "" Then
LoadTimeCard
Else: Exit Sub
End If
End Sub
Code:
Function LoadTimeCard()Dim sourceWB As Workbook
Dim sourceWS As Worksheet
Dim xlApp As Object
Set xlApp = CreateObject("Excel.Application")
With xlApp
.Visible = False
.EnableEvents = False
End With
strFile = "C:\TimeCard\PCI_TimeCard.xlsm"
Set sourceWB = Workbooks.Open(strFile, , True, , , , , , , True)
Set sourceWS = Worksheets("2678")
sourceWB.Activate
TimeCard.tbEmployeeID.Value = Worksheets("2678").Range("C2")
TimeCard.tbEmployeeName.Value = Worksheets("2678").Range("C3")
TimeCard.tbDepartment.Value = Worksheets("2678").Range("C4")
TimeCard.tbPayPeriod.Value = Worksheets("2678").Range("C5")
sourceWB.Close
xlApp.Application.Quit
Set xlApp = Nothing
End Function
Thank you in advance for any and all suggestions
OldCityCat