Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default XL file opened using automation - how close?

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!

  #2   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default XL file opened using automation - how close?

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!

  #3   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default XL file opened using automation - how close?


Thanks so much Jacob! That works!

May I just ask one last thing? Say my file name is "MyBook.xlsm" - is there
a way to get a reference just to that file and close only that file?

"Jacob Skaria" wrote:

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!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
XL file opened using automation - how close? Jacob Skaria Excel Programming 0 May 27th 10 09:32 PM
XL file opened using automation - how close? xp Excel Programming 0 May 27th 10 09:11 PM
Book1 default - does not close once another file is opened MaryM New Users to Excel 1 February 22nd 09 04:49 AM
Close file and run macro from newly opened file Pradip Jain Excel Programming 1 April 23rd 05 11:39 PM
Problem with quitting Excel opened through automation Michelle Excel Programming 2 January 8th 04 07:54 PM


All times are GMT +1. The time now is 11:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"