[AccessD] Code not letting go of Excel

Bobby Heid bheid at appdevgrp.com
Fri Jun 30 05:58:28 CDT 2006


Are you using objXLApp.Quit anywhere before you set objXLApp to nothing?  I
did not see it in the code.

Bobby

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of ewaldt at gdls.com
Sent: Friday, June 30, 2006 6:25 AM
To: accessd at databaseadvisors.com
Subject: [AccessD] Code not letting go of Excel


I can't find anything wrong with this code, but Excel does not completely
close down (i.e., it shows up in Task Manager). Could someone tell me what
I'm missing, please? BTW, thanks to Duane Hookum for providing much of it;
I'm sure the error is in my part, not his.

TIA.

Thomas F. Ewald
FCS Database Manager
General Dynamics Land Systems
(586) 276-1256

-----------------------------------------------------------------------
Sub IPT_Export()
Dim objXLApp As Object
Dim objXLbook As Excel.Workbook
Dim astrLinks As Variant
Dim strFileName As String

strFileName = InputBox("What should the new file be named? ", "Request for
Information") & ".xls"

Set objXLApp = CreateObject("Excel.Application")
Set objXLApp = New Excel.Application
Set objXLbook = objXLApp.Workbooks.Open("WRI_IPT.xlt", 0)

DoCmd.SetWarnings False

objXLbook.SaveAs (strFileName)

astrLinks = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks)
ActiveWorkbook.BreakLink _
        Name:=astrLinks(1), _
        Type:=xlLinkTypeExcelLinks
objXLbook.Save
objXLbook.Close

Set objXLbook = Nothing
Set objXLApp = Nothing

DoCmd.SetWarnings True

End Sub






This is an e-mail from General Dynamics Land Systems. It is for the intended
recipient only and may contain confidential and privileged information.  No
one else may read, print, store, copy, forward or act in reliance on it or
its attachments.  If you are not the intended recipient, please return this
message to the sender and delete the message and any attachments from your
computer. Your cooperation is appreciated.
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list