XL file opened using automation - how close?
Missed error handling...
Dim appExcel
On Error Resume Next
Set appExcel = GetObject(, "Excel.Application")
On Error Goto 0
If Not appExcel is Nothing Then
appExcel.DisplayAlerts = False
appExcel.Quit
End If
--
Jacob (MVP - Excel)
"Jacob Skaria" wrote:
If you have a scripting tool use the below code. OR .Paste the below code to
a notepad and save as <somefilename.vbs. From explorer double click the file
to execute/
Dim appExcel
Set appExcel = GetObject(, "Excel.Application")
If Not appExcel is Nothing Then
appExcel.DisplayAlerts = False
appExcel.Quit
End If
--
Jacob (MVP - Excel)
"xp" wrote:
Hi Jacob,
Thanks; however, I should have been more clear in my original post, how can
I do this programmatically? Is it possible to get a reference to the running
instance from a separate file (say VBScript or XL) and close the file?
If so how?
Thanks again!
"Jacob Skaria" wrote:
Did you try after closing Excel Application.
If it is hidden instance from 'Task Manager'close all 'Excel applications'
and then try
--
Jacob (MVP - Excel)
"xp" wrote:
I have a program that is run by Scheduled Task. This program opened an XL
file using automation as designed, however, now the file is hanging open and
I can only get to it "read only".
How can I regain control over this file and close it?
Thanks!
|