Hi,
I have some Code in Outlook to output data to Excel. I get the data out fine with the code below and the user is left with viewing the Excel Sheet as I want. However, when the User closes the Excel File, Windows says that Excel is still open (even though I can't see it) and I get errors on trying to use Excel and on Shut Down.
How do I Finish the Code to stop this?
Code using is...
Sub OutPutToExcel
Set oExcel = Item.Application.CreateObject("Excel.Application"
oExcel.Visible = True
oExcel.Workbooks.Add
Set oSheet = oExcel.Workbooks(1).Worksheets("Sheet1"
oSheet.Activate
set oSheetTitle = oSheet.Range("A1"
oSheetTitle.Value = "Output Data"
End Sub
Thanks
Grippen
I have some Code in Outlook to output data to Excel. I get the data out fine with the code below and the user is left with viewing the Excel Sheet as I want. However, when the User closes the Excel File, Windows says that Excel is still open (even though I can't see it) and I get errors on trying to use Excel and on Shut Down.
How do I Finish the Code to stop this?
Code using is...
Sub OutPutToExcel
Set oExcel = Item.Application.CreateObject("Excel.Application"
oExcel.Visible = True
oExcel.Workbooks.Add
Set oSheet = oExcel.Workbooks(1).Worksheets("Sheet1"
oSheet.Activate
set oSheetTitle = oSheet.Range("A1"
oSheetTitle.Value = "Output Data"
End Sub
Thanks
Grippen