i'm using the following to read public folder emails (orders) and copy to Excel (works well):
but after the user is done with Excel (closes the App), goes back to Outlook, etc., and later in the day copies out to Excel agian (code below), Excel won't function properly (when i look in Task Manager, the Excel is not listed under the Application tab, but it is still listed in Processes)...?
'take counts of Orders (in textboxes) and copy to predetermined xls
'open excel from outlook, take counts from public folders,
'leave Excel open for user to work in (user closes Excel and goes back to
'Outlook, etc.
Dim xlApp As Object
Dim sourceWB As Workbook
Dim sourceSH As Worksheet
Set xlApp = CreateObject("Excel.Application")
With xlApp
.Visible = True
.EnableEvents = False
End With
strFile = "C:\temp\ex_with_Outlook.xlsx"
Set sourceWB = Workbooks.Open(strFile, , False, , , , , , , True)
Set sourceSH = sourceWB.Worksheets("OF")
sourceWB.Activate
Range("a1").Select
Range("A65536").End(xlUp).Select
ActiveCell.Offset(1, 0).Select
ActiveCell = Now()
ActiveCell.Offset(0, 1).Value = txtInboxTodaysDate
ActiveCell.Offset(0, 2).Value = txtIDeletedToday
ActiveCell.Offset(0, 3).Value = txtIDeletedYesterday
'keep workbook open for user to peruse, etc.
Display More
???
thank you...