Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Easy One - Opening Other Appliactions (Excel) from in Outlook

Status
Not open for further replies.

Grippen

Technical User
Sep 3, 2001
24
GB
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top